Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

remote registry querying script

Status
Not open for further replies.

teletubby5e

Technical User
Oct 31, 2002
147
US
hello,
i am looking to find a way of automating a query on a particular key in the registry on all my client pc's. for example the service tag number of a dell pc. i find it in several keys, but this looks like the most common ...

Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Dell\America Online 9.0]
"ServiceTag"="WGS8W61"

has anyone messed around with a way of automating registry queries that can share that experience with me?

thanks, jeff

 
You will want to use WMI instead of querying the registry.

Code:
strComputer = "."
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_
".\root\default:StdRegProv")
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")

report = strComputer & " Computer Inventory" & vbCrLf & "******************************************" & vbCrLf & vbCrLf

Set colSMBIOS = objWMIService.ExecQuery ("Select * from Win32_SystemEnclosure")
For Each objSMBIOS in colSMBIOS
	If objSMBIOS.SerialNumber <> "" Then
    	report = report &  "Dell Service Tag: "  & objSMBIOS.SerialNumber & vbCrLf
    End If
Next

Refer to my FAQ faq329-4871 for instructions on how to run this same code against multiple machines remotely.

I hope you find this post helpful.

Regards,

Mark
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top