WMI to a BigFix Analyses

(imported topic written by SystemAdmin)

Is there an Analyses equivalent to the WMI code listed below? It checks for a specific BIOS setting on an HP laptop. I know BF only has two BIOS inspectors, but I figured it could read WMI…

strComputer = “.”

Set objWMIService = GetObject(“winmgmts:\” & strComputer & “\root\HP\InstrumentedBIOS”)

Set colItems = objWMIService.ExecQuery( _

“SELECT * FROM HPBIOS_BIOSEnumeration WHERE Name = ‘LAN/WLAN Switching’”,48)

For Each objItem in colItems

Wscript.Echo “-----------------------------------”

Wscript.Echo “HPBIOS_BIOSEnumeration instance”

Wscript.Echo “-----------------------------------”

Wscript.Echo "Value: " & objItem.Value

Next

(imported comment written by Lee Wei)

The equivalent BigFix Relevance statement to access WMI is:

selects “* from HPBIOS_BIOSEnumeration WHERE Name = ‘LAN/WLAN Switching’” of wmi “\root\HP\InstrumentedBIOS”

A better statement with some error checking is:

if (exists wmi and exists wmi “\root\HP\InstrumentedBIOS”) then (selects “* from HPBIOS_BIOSEnumeration WHERE Name = ‘LAN/WLAN Switching’” of wmi “\root\HP\InstrumentedBIOS”) as string else “HP InstrumentedBIOS WMI Namespace not installed”

(imported comment written by SystemAdmin)

Thank you very much, Lee. This was VERY helpful!

-Ken