R
Raymond Balaian
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
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