#PSTip Access remote registry using PowerShell
Using the Microsoft.Win32.Registry class it is possible to access both–the local registry and, more importantly, the registry of a remote system. Using the PowerShell cmdlet this is unfortunately not possible. Ravikanth posted a similar tip in PowerShell Magazine in which he uses it to retrieve SQL instance names using remote registry.
The following code will retrieve a list of sub keys from the HKLM:\Software path in the registry on Server1 computer:
|
|
Using this information it is possible to extract a value from the subkey as well. The following code sample will extract the path parameter from the first subkey in the Software container.
|
|
For more information about this class and the available methods please refer to the MSDN article:
Share on: