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.

It works with Windows 7 and Windows 10.

How to use the script?

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 system BIOS).

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


VBS Script:


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
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 to Dave Huttner Cancel reply

Your email address will not be published. Required fields are marked *