WQL Help - Win32_NetworkAdapterConfiguration
Hi guys/girls,

I can't seem to figure out how to filter out the NICs without default gateway set:



More readable version:

gwmi -Query 'SELECT IPAddress FROM Win32_NetworkAdapterConfiguration WHERE DefaultIPGateway IS NOT NULL'

gwmi -Query 'SELECT IPAddress FROM Win32_NetworkAdapterConfiguration WHERE DefaultIPGateway <> ""'

It seems like the DefaultIPGateway property is always an array.  If this is the case how do we say "something equals to an empty array" in WQL??


February 12th, 2015 12:39pm

Get-WmiObject Win32_NetworkAdapterConfiguration -filter 'IPEnabled=True'|where{$_.DefaultIPGateway}

Free Windows Admin Tool Kit Click here and download it now
February 12th, 2015 1:16pm

Get-WmiObject Win32_NetworkAdapterConfiguration -filter 'IPEnabled=True'|where{$_.DefaultIPGateway}

February 12th, 2015 2:41pm

You cannot test on arrays and complex objects.; only on strings, booleans and numbers.

Free Windows Admin Tool Kit Click here and download it now
February 12th, 2015 3:16pm

You cannot test on arrays and complex objects.; only on strings, booleans and numbers.

February 12th, 2015 3:26pm

YUP it is right here I n black and blue and white:

https://msdn.microsoft.com/en-us/library/aa392902(v=vs.85).aspx

About the ninth paragraph: "Note  WQL does not support queries of array datatypes."

Free Windows Admin Tool Kit Click here and download it now
February 12th, 2015 3:44pm

YUP it is right here I n black and blue and white:

https://msdn.microsoft.com/en-us/library/aa392902(v=vs.85).aspx

About the ninth paragraph: "Note  WQL does not support queries of array datatypes."

February 12th, 2015 3:54pm

Microsoft has always been schizo about WMI documentation.
Free Windows Admin Tool Kit Click here and download it now
February 12th, 2015 4:33pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics