≡ Menu

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

{ 3 comments… add one }
  • Uma September 12, 2011, 6:07 pm

    Can I get the code for VB Script?

  • parag waghmare September 16, 2011, 5:27 am

    Thanks sitaram, this is just what i needed.

Leave a Comment