No, it doesn't.
I have a laptop w/a wireless network PCMCIA card & a integrated NIC. I have both set to use DHCP, but usually only 1 will be in use (i.e. if I am wireless, I won't use a CAT5 cable). So, both show up w/DHCP being enabled. The unused adapter has an empty IPAddress array.
If I am on the internet by dialup, the IPAddress array isn't empty but DHCP is not enabled (also, subnet mask is reported as 255.255.255.255... don't exactly know that works... I have MSN for dial up.)
So, I would still like the query to refer to the IPAddress array, I am usuing the following currently as a workaround:
<code>
Dim strComputer, CRLF
Dim colDrives, strMsg
Dim WSHNetwork
strComputer = "."
CRLF = Chr(13) & Chr(10)
Set NetworkPROP = WScript.CreateObject("WScript.Network")
Set objWMIService = GetObject _
("winmgmts:" & "!\\" & strComputer & "\root\cimv2")
Set colAdapters = objWMIService.ExecQuery _
("Select * from Win32_NetworkAdapterConfiguration Where IPEnabled=True")
For Each objAdapter in colAdapters
If objAdapter.IPAddress(0)<>"" then
Msgbox "UserName " & Chr(9) & "= " & NetworkPROP.UserName & CRLF & _
"Host name: " & Chr(9) & "= " & ucase(objAdapter.DNSHostName) & CRLF & _
"IP address: " & Chr(9) & "= " & objAdapter.IPAddress(0) & CRLF & _
"IP subnet: " & Chr(9) & "= " & objAdapter.IPSubnet(0) & CRLF & _
"Description: " & Chr(9) & "= " & objAdapter.Description & CRLF & _
"User Domain: " & Chr(9) & "= " & NetworkPROP.UserDomain & CRLF & _
"Physical address: " & Chr(9) & "= " & objAdapter.MACAddress & CRLF & _
"DHCP enabled: " & Chr(9) & "= " & objAdapter.DHCPEnabled, _
vbinformation + vbOKOnly + vbmsgboxsetforeground, _
"Network Properties"
end if
Next
</code>
Thanx for the effort.