- April 17, 2016 at 8:40 am #37904
How would one get to the HKEY_Users key in the registry using powershell? I am seeing that it would have to be possible to look it up by the .net classes.
One example I see is
$Reg = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey('LocalMachine', 'computername')
Would the key be users in this case?
The key that I am looking for is
HKEY_Users\.DEFAULT\Control Panel\International and the LocalName value.
Wei-YenApril 17, 2016 at 12:57 pm #37911
Simple, try this:
Set-Location -Path HCKU:
EDIT: I was too quick with answering. Be aware that you need to script this. There's no native way (besides using .NET, as you already figured out), to access the .DEFAULT hive.April 17, 2016 at 1:23 pm #37914
I've tried posting this a few times, but it has not shown up for some reason. Here it is again without the source reference which appears to be what it causing it to not display.
Get-ItemProperty -Path "Registry::\HKEY_USERS\.DEFAULT\Control Panel\International"April 17, 2016 at 1:28 pm #37915
I take my words back. Curtis is the man! _0_April 17, 2016 at 1:36 pm #37916
Thanks Richard.April 17, 2016 at 1:38 pm #37917
You could use Invoke-Command for that.April 17, 2016 at 2:14 pm #37918
You could create a PSDrive using the Registry provider:
New-PSDrive HKU -Root HKEY_Users -PSProvider Registry Get-ChildItem HKU:\.defaultApril 17, 2016 at 2:36 pm #37919
Thanks guys, you have given a bit more perspective
You must be logged in to reply to this topic.