Access Remote machine registry

  • Thread starter Thread starter Steve Montgomery
  • Start date Start date
S

Steve Montgomery

Does anyone have a sample block of code they can share for checking a
DWORD value on a remote network machine's registry? For example, to
validate a patch deployment.

MSDN has a great sample for access the local registry bur I'd like to
mount several remote registry to check a specific key for a DWORD
value.

Thanks,
Steve
 
Thanks so much... It was far easier than I would have expected! You
guys are a LIFE SAVER!

Here's the template I'm using....anyone else who needs to access a
remote system registry, this works and it's very fast.

Private Sub Q2()
Dim remotepc
remotepc = Host.Text
Dim MyVal As String

Dim oRegH As RegistryKey
Dim RegWord As RegistryKey
Dim ReturnVal As String
oRegH =
RegistryKey.OpenRemoteBaseKey(RegistryHive.LocalMachine, remotepc)
RegWord = oRegH.OpenSubKey("Software\Microsoft\Windows
NT\CurrentVersion")
MyVal = RegWord.GetValue("RegisteredOwner")
WMIResults.Items.Add(MyVal)


End Sub
 
* Steve Montgomery said:
Here's the template I'm using....anyone else who needs to access a
remote system registry, this works and it's very fast.

Thank you for sharing this piece of source code with the group!
 
Back
Top