strComputer = "."
oWMI = GetObject( "winmgmts:\\" : strComputer : "\root\cimv2")
WQL = 'SELECT * FROM SoftwareLicensingService'
oLicSvc = oWMI.ExecQuery(WQL)
ForEach m in oLicSvc
v="Version: ":m.Version
c="Client ID: ":m.ClientMachineID
p="Product Key: ":m.OA3xOriginalProductKey
k="KMS ID: ":m.KeyManagementServiceProductKeyID
message("",v:@LF:c:@LF:p:@LF:k)
Next
oLicSvc=0
oWMI=0
Exit