Home All Groups Group Topic Archive Search About


Author
9 Aug 2005 2:32 PM
future_retro
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.

Author
9 Aug 2005 9:20 PM
J Ford
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.
>
>
Author
10 Aug 2005 9:43 AM
future_retro
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.
Author
10 Aug 2005 9:58 AM
future_retro
sorry just reread my original post and realise I didn't point out that
I was using WMI filtering in GPMC

AddThis Social Bookmark Button