Home > Hardware > Script to Get the Windows Machine Serial Number

Script to Get the Windows Machine Serial Number

On Error Resume Next
Dim strComputer
strComputer = InputBox(“Enter the name of the computer:”)
Set objWMIService = GetObject(“winmgmts:” & “{impersonationLevel=impersonate}!” & strComputer & “rootcimv2″)
Set colSMBIOS = objWMIService.ExecQuery (“Select * from Win32_SystemEnclosure”)
For Each objSMBIOS in colSMBIOS
MsgBox strComputer & “: ” & objSMBIOS.SerialNumber
Next

Categories: Hardware Tags:
  1. No comments yet.
  1. No trackbacks yet.
You must be logged in to post a comment.