我有这个脚本,可以通过输入计算机名来搜索计算机序列号。你能帮我扭转一下吗?那么它会通过输入序列号找到计算机名称吗?
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)