(imported comment written by brolly3391)
Welcome Paul,
The short answer is no, there is no decent way to do that. However there may be an indecent way.
Check out these statements:
Looking over the WMI class you provided just to see what it looks like. We will not be using this relevance in our final product.
q: (concatenation “|” of (property “InstanceName” of it as string;property “Enable” of it as string)) of select objects “Enable,InstanceName from MSPower_DeviceWakeEnable” of WMI “root\WMI”
A: InstanceName=PCI\VEN_8086&DEV_266D&SUBSYS_542314F1&REV_03\3&61aaa01&0&F3_0|Enable=True
A: InstanceName=PCI\VEN_14E4&DEV_1677&SUBSYS_01821028&REV_01\4&2959cbdc&0&00E0_0|Enable=False
T: 10.474 ms
I noticed that my laptop showed that my NICs do not have WOL Enabled but my modem does? Might need more research on what that WMI class really does.
But we are steaming onward toward your answer. Lets filter our WMI results by Enable=True and then extract just the device ID portion of the return values.
q: substrings between “” of ((property “InstanceName” of it as string) of select objects “Enable,InstanceName from MSPower_DeviceWakeEnable” whose (property “Enable” of it as string contains “True”) of WMI “root\WMI”)
A: VEN_8086&DEV_266D&SUBSYS_542314F1&REV_03
T: 10.297 ms
Now lets look up that (those) device string(s) in the registry to see if one of them has class “Net” (formatting for ease of understanding):
q: exists keys
(substrings between “” of ((property “InstanceName” of it as string) of select objects “Enable,InstanceName from MSPower_DeviceWakeEnable” whose (property “Enable” of it as string contains “True”) of WMI “root\WMI”))
whose
(exists keys whose ( value “Class” of it as string = “Net”) of it)
of keys of key “HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Enum” of registry
A: False
T: 348.466 ms
Or you could turn it around and find the names of NICs that have WOL off
q: values “DeviceDesc” of keys of keys
(substrings between “” of ((property “InstanceName” of it as string) of select objects “Enable,InstanceName from MSPower_DeviceWakeEnable” whose (property “Enable” of it as string contains “False”) of WMI “root\WMI”))
whose
(exists keys whose ( value “Class” of it as string = “Net”) of it)
of keys of key “HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Enum” of registry
A: Broadcom NetXtreme 57xx Gigabit Controller
T: 343.741 ms
That is the raw idea. The relevance needs some more existence tests to avoid errors if the machine does not have any of the items we are querying for.
Finally the WMI warning: Notice that the final query takes 1/3 of a second? This is not uncommon with WMI queeries. The BES client only uses 2% of the total processor so roughly 1/3 second X 50 = 17 seconds. That is an eternity. If you were to use something like this you would want to have it report daily or less frequently.
Cheers,
Brolly