Jump to content
EduGeek EdSec 2026 is Go! 27th Oct in Derby! Join us for a day of EdTech security focused talks, networking, and an evening social ×

Recommended Posts

Posted

alternate method :

 

wmic bios get serialnumber

 

or for a remote PC:

 

wmic /node:"remote-pc-name-here" bios get serialnumber

  • Thanks 1
Posted

I did the same as below but instead of using strComputer="." I replaced that with an input box to request for the computer name might be other ways of doing this but have not tried.

 

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colSMBIOS = objWMIService.ExecQuery _
("Select * from Win32_SystemEnclosure")
For Each objSMBIOS in colSMBIOS
Wscript.Echo "Dell Service Tag: " & objSMBIOS.SerialNumber
Next

 

code I used :

 

strComputer = InputBox("Please enter the computername or I.P Address")
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colSMBIOS = objWMIService.ExecQuery _
("Select * from Win32_SystemEnclosure")
For Each objSMBIOS in colSMBIOS
Wscript.Echo "Dell Service Tag: " & objSMBIOS.SerialNumber
Next

 

The machine has to at least be switched on and at the logon screen and if the machine in question has the ports blocked related to WMI and that sort of thing obviously it will fail. Generally windows firewall is switched off so should work if thats the case unless there are other things that could possibly / maybe stop or block the traffic ( VLAN ??? ) not sure.

Posted
Great for single machines. What would be even better would be a version that looked for machine name from a text file and the dumped the values to another text file along with the machince name.

This would be great when installing new machines, no need to manually take down each service tag.

 

I did try and look into that when doing the above script but never got around to it due to time constraints - although I do know you can use arrays to store the computer names and do it that way and its easily enough written into another text file.

 

Short of that you can use ADUC and retrieve the computer names from each OU and do it on a per OU basis ?

Posted
FWIW, same thing can be achieved with dmidecode - there are windows binaries available, but usefully it is very cross-platform. ISTR it is now part of standard Smoothie build (I have been rolling my own for years) so you should be able to quiz most of your kit now ;)

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...