I am using a WMI query as part of a general diagnostic script, and I query the following:
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
Set colItems = objWMIService.ExecQuery( _
"SELECT * FROM Win32_PnPEntity",,48)
For Each objItem in colItems
Wscript.Echo "-----------------------------------"
Wscript.Echo "Win32_PnPEntity instance"
Wscript.Echo "-----------------------------------"
Wscript.Echo "Caption: " & objItem.Caption
Wscript.Echo "ClassGuid: " & objItem.ClassGuid
Wscript.Echo "ConfigManagerErrorCode: " & objItem.ConfigManagerErrorCode
Wscript.Echo "Description: " & objItem.Description
Wscript.Echo "DeviceID: " & objItem.DeviceID
Wscript.Echo "Manufacturer: " & objItem.Manufacturer
Wscript.Echo "Name: " & objItem.Name
Wscript.Echo "PNPDeviceID: " & objItem.PNPDeviceID
Wscript.Echo "Service: " & objItem.Service
Wscript.Echo "Status: " & objItem.Status
Next
Whenever I run this on a workstation with PS/2 ports, I get that both a PS/2 Keyboard and Mouse (not present) are showing the error code for [Not Present, Not Working, No Driver Installed].
Is there any way to differentiate this from other devices that are actually failed? I'd like to still show PS/2 Errors, if possible, but dont see what I could use to separate these from the real entries.