|
server
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
WMI filter for IPAddress
Hi all,
I can't query the win32_networkadapterconfiguration setting as the IPAddress is an Array. As far as I'm aware I can only use WQL queries and not full scripts to filter. Could someone confirm this for me, info on the web seems a bit light. Cheers, Marc. I am not quite sure what you mean by "full scripts to filter" but you can get
the array info out. <sample 1> On Error Resume Next strComputer = "." Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2") Set colItems = objWMIService.ExecQuery("Select IPAddress from Win32_NetworkAdapterConfiguration WHERE IPEnabled='True'",,48) For Each objItem in colItems For Each strIPAddress in objItem.IPAddress Wscript.Echo "IP Address: " & strIPAddress Next Next </sample 1> <sample 2> On Error Resume Next strComputer = "." Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2") Set colItems = objWMIService.ExecQuery("SELECT IPAddress FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled='True'") For Each objItem In colItems strIPAddress = Join(objItem.IPAddress, ",") WScript.Echo "IPAddress: " & strIPAddress Next </sample 2> Both were pulled from Scriptomatic. Show quote "future_re***@yahoo.co.uk" wrote: > Hi all, > > I can't query the win32_networkadapterconfiguration setting as the > IPAddress is an Array. As far as I'm aware I can only use WQL queries > and not full scripts to filter. Could someone confirm this for me, > info on the web seems a bit light. > > Cheers, Marc. > > agreed this works fine as a vb script but can this be used for wmi
filtering in the GP Management snapin? I can only seem to get it working with wql queries. |
|||||||||||||||||||||||