VBS Script – Get Computer Serial Number Remotely

The following script can be used to remotely access the serial number for a computer on your network.

Output:

When you run the script it will prompt for the computer name:

After entering the computer name and pressing ‘OK’ it will return the part number, serial number and asset tag. (if saved to the systems BIOS).

The serial number is presented in a text box which allows you to copy and paste it into another window.

VBS Script:

Download

MyHostName = InputBox ("Enter Machine Name")
Set objWMIService = GetObject("winmgmts:" _
            & "{impersonationLevel=impersonate}!\\" & MyHostName & "\root\cimv2")
Set colSMBIOS = objWMIService.ExecQuery _
            ("Select * from Win32_SystemEnclosure")
  For Each objSMBIOS in colSMBIOS            
    pn = "Part Number: " & objSMBIOS.PartNumber
    sn = "Serial Number: " & objSMBIOS.SerialNumber
    sn1 =  objSMBIOS.SerialNumber
    an = "Asset Tag: " & objSMBIOS.SMBIOSAssetTag
  Next
tmp = InputBox (pn & VBCrLf & sn  & VBCrLf & an,"Computer Serial Number",sn1)

Related Articles

2 comments on “VBS Script – Get Computer Serial Number Remotely

  1. Hello,

    I am an IT consulting for a lot of small business that are just in workgroups, to small to have a domain. Is there anyway to run this for computers in a workgroup? I have matching Administrator user accounts and password across all computers.

    Thank you,

Leave a Reply

Your email address will not be published.