'UUID.vbs
'Displays the UUID of a computer
'By Mitch Tulloch (www.mtit.com)
strComputer = "."
strWMINamespace = "\root\CIMV2"
Set objSWbemServices = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colSWbemObjectSet = objSWbemServices.ExecQuery("SELECT * FROM Win32_ComputerSystemProduct")
For Each objSWbemObject In colSWbemObjectSet
   strIdentifyingNumber = objSWbemObject.IdentifyingNumber
   strName = objSWbemObject.Name
   strVersion = objSWbemObject.Version
Next
strWMIQuery = ":Win32_ComputerSystemProduct.IdentifyingNumber='" & strIdentifyingNumber _
   & "',Name='" & strName & "',Version='" & strVersion & chr(39)
Set objWMIService = GetObject("winmgmts:\\" & strComputer & strWMINamespace & strWMIQuery)
For Each objItem in objWMIService.Properties_
    If objItem.name =  "UUID" Then
        Wscript.Echo objItem.name & " = " & objItem.value
    End If
Next