Thanks /\/\o\/\/!
it works great on local machine but won't work on remote servers (wi2008 or
win2003)
here is error that comes as a result:
Exception calling "OpenRemoteBaseKey" with "2" argument(s): "Attempted to
perform an unauthorized operation."
At D:\temp\getregperm.ps1:2 char:56
+ $reg = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey <<<<
('LocalMachine',
You cannot call a method on a null-valued expression.
At D:\temp\getregperm.ps1:4 char:25
+ $regKey= $reg.OpenSubKey <<<< ("Software\Microsoft" )
You cannot call a method on a null-valued expression.
At D:\temp\getregperm.ps1:5 char:25
+ $regkey.GetAccessControl <<<< ().GetAccessRules($true,$true,
not sure about the problem..
thanks for your help!
Post by /\/\o\/\/ [MVP]$MachineName = 'server'
$reg = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey('LocalMachine',
$MachineName)
$regKey= $reg.OpenSubKey("Software\Microsoft" )
$regkey.GetAccessControl().GetAccessRules($true,$true,
[System.Security.Principal.NTAccount])
Enjoy,
Greetings /\/\o\/\/
http://thePowerShellGuy.com
Post by Marco Shaw [MVP]Post by UCHi
I am wondering if there is anything that I can use to get registry
permissions using powershell of a remote server. for example, how can I get
permission of one of my remote server named server01 registry key
HKLM\Software\Microsoft ?
Any help or direction will be greatly appreciated.
UC
What OS? Do you have Windows Remote Management (winrm) installed?
--
Microsoft MVP - Windows PowerShell
http://www.microsoft.com/mvp
PowerGadgets MVP
http://www.powergadgets.com/mvp
http://marcoshaw.blogspot.com