WMI and IPAddresses
- From: "Raymond Balaian" <raymond dot balaian at kp dot org>
- Date: Thu, 7 Jul 2005 14:25:52 -0700
Hi all, hope this is the right place for this.
I have our workstations set up to run system startup scripts to get the
IPAddress of the client, and its behaving stragely when the computer has a
wired NIC and a wireless NIC.
Here is the code:
-----------------------------------
Set activeIPConfigSet = GetObject("winmgmts:").ExecQuery ("select IPAddress,
IPSubnet from Win32_NetworkAdapterConfiguration where IPEnabled=true")
For Each ipConfig in activeIPConfigSet
For i = LBound(ipConfig.IPAddress) to UBound(ipConfig.IPAddress)
tmpIP = ipConfig.ipAddress(i)
If tmpIP <> "0.0.0.0" AND Left(tmpIP,4) <> "169." Then
IPAddress = tmpIP
Exit For
Else
IPAddress = "0.0.0.0"
End If
Next
Next
-----------------------------------
Here is what happens:
Wireless and Wired BOTH enabled - IPAddress = 0.0.0.0
Wired Enabled only - IPAddress = 10.10.10.10 (or any good IP)
Wireless Enabled only - IPAddress = 0.0.0.0
Is there something I'm missing here?
Thanks,
Ray
.
- Follow-Ups:
- Re: WMI and IPAddresses
- From: Scott McNairy \(MVP\)
- Re: WMI and IPAddresses
- Prev by Date: weird WMI problem in event viewer
- Next by Date: Re: WMI and IPAddresses
- Previous by thread: weird WMI problem in event viewer
- Next by thread: Re: WMI and IPAddresses
- Index(es):
Relevant Pages
|