Home > PowerShell > Check for remote registry existance with Powershell

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

No related content found.

Categories: PowerShell
  1. Uma
    September 12, 2011 at 6:07 pm | #1

    Can I get the code for VB Script?

  2. parag waghmare
    September 16, 2011 at 5:27 am | #2

    Thanks sitaram, this is just what i needed.

  1. No trackbacks yet.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>