Community FAQ
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
abueg
Engaged Sweeper
Here is a script for viewing the Asset Tag and Serial Number for a remote computer.
It works as a custom action and also as standalone.
Attached is the vbs script, just change the txt extension to vbs.

Custom action command:

"\\server\folder\AssetTag.vbs" {computer}

AssetTag.vbs code:


On Error Resume Next
strPC = WScript.Arguments(0)
If strPC = "" Then
strPC = InputBox("Remote Computer:", "Remote PC Asset Tag")
End if
strComputer = strPC
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_SystemEnclosure",,48)

For Each objItem in colItems

strTag = "Asset Tag: " & objItem.SMBIOSAssetTag

Next

On Error Resume Next

Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_BIOS",,48)

For Each objItem in colItems

strSerial = "Serial Number: " & objItem.SerialNumber

Next

WScript.Echo "Computer Name: " & strComputer & vbCrLf & strSerial & vbCrLf & strTag




1 REPLY 1
kh-vince
Moderator
Moderator


Hello everyone,
Due to the age of this post, it has been archived. Please feel free to start a new post if you wish to continue to discuss this topic.
Thank you for understanding.

Archive

This board contains archived posts from the retired Lansweeper Forum and Insiders Community.

New to Lansweeper?

Try Lansweeper For Free

Experience Lansweeper with your own data.
Sign up now for a 14-day free trial.

Try Now