Techibee.com

Check for remote registry existance with Powershell

Here is a sample powershell script which helps you to check for a registry existance in remote machine.  By exploring [Microsoft.Win32.RegistryKey] API you can do much more with registry administration in powershell.

$host = “RemoteComputer”
$Hive = [Microsoft.Win32.RegistryHive]”LocalMachine”;
$regKey = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey($Hive,$host);
$ref = $regKey.OpenSubKey(“SOFTWAREMicrosoftwindowsCurrentVersionUninstall”);
if (!$ref) {$false}
else {$true}

Happy Learning..,
Sitaram Pamarthi

Exit mobile version