→ 🚀What's New? Explore Lansweeper's Fall 2024 Updates! Fall Launch Blog !

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.