WMI and IPAddresses



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









.



Relevant Pages

  • Re: Threading a server
    ... TcpClient client = this.tcpListener.AcceptTcpClient; ... are potentially many connections required at a time. ... System.Net.IPAddress ipaddress = System.Net.IPAddress.Any; ... If I send one email at a time to the server, it works fine, and as long as ...
    (microsoft.public.dotnet.languages.csharp)
  • IP address resolution.
    ... I have a box which needs to be configured to the IPAddress which the client wishes. ... then he gives 'telnet x.x.x.x portno' portno is my box's portno. ... While doing telnet the packets are coming to the box but they are dropped at the ethernet level. ...
    (RedHat)
  • Re: Remoting Server Client - Client Server
    ... > Dim ipAddress As IPAddress = ipHostInfo.AddressList ... > Damit kann sich ein Client am Server mit einem Remoting-Aufruf anmelden, ... Server Client Kommunikation direkt erfolgen kann. ...
    (microsoft.public.de.german.entwickler.dotnet.framework)