Lurka
2006-01-19 14:23:47 UTC
Hello,
this issue comes up periodically, especially when people have to check
a thousand computers for serial numbers.
The following simple VBA script I found out there works fine (provided
I have admin rights on the target machine).
strComputer = "[COMPUTER NAME HERE]"
Set objWMIService = GetObject("winmgmts:" &
"{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colSMBIOS = objWMIService.ExecQuery ("Select * from
Win32_SystemEnclosure")
For Each objSMBIOS in colSMBIOS
Wscript.Echo "Serial Number: " & objSMBIOS.SerialNumber
Next
I'd like to "extend" the above script to browse through a given list of
machine names and report the results in a CSV text file, including the
following properties: __SERVER, SerialNumber, Manufacturer, currently
logged user.
The logged user does not appear in the Win32_SystemEnclosure class, of
course: which class is it listed in?
Some network administrative utilities include wizards to perform WMI
queries, e.g. Hyena by SystemTools Software, but it seems that Hyena
can only query a single class at once.
Do you know of more sophisticated tools that allow to create reports
form WMI queries?
Thank you,
/_urka
this issue comes up periodically, especially when people have to check
a thousand computers for serial numbers.
The following simple VBA script I found out there works fine (provided
I have admin rights on the target machine).
strComputer = "[COMPUTER NAME HERE]"
Set objWMIService = GetObject("winmgmts:" &
"{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colSMBIOS = objWMIService.ExecQuery ("Select * from
Win32_SystemEnclosure")
For Each objSMBIOS in colSMBIOS
Wscript.Echo "Serial Number: " & objSMBIOS.SerialNumber
Next
I'd like to "extend" the above script to browse through a given list of
machine names and report the results in a CSV text file, including the
following properties: __SERVER, SerialNumber, Manufacturer, currently
logged user.
The logged user does not appear in the Win32_SystemEnclosure class, of
course: which class is it listed in?
Some network administrative utilities include wizards to perform WMI
queries, e.g. Hyena by SystemTools Software, but it seems that Hyena
can only query a single class at once.
Do you know of more sophisticated tools that allow to create reports
form WMI queries?
Thank you,
/_urka