Quantcast
Channel: Sysinternals Forums
Viewing all articles
Browse latest Browse all 10386

BgInfo : Multiple NICs

$
0
0
Author: WindowsStar
Subject: Multiple NICs
Posted: 16 January 2013 at 4:59am

Try this for the IP address:
 
' Special BGInfo Script
' Network Enabled Address IP4 v2.3
' Programmed by WindowsStar - Free to Use (c) 2009-2013
' --------------------------------------------------------
strComputer = "."
Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery ("Select * From Win32_NetworkAdapter WHERE NetConnectionStatus=2")
For Each objItem in colItems
If objItem.MACAddress <> NUL Then strMACAddress = strMACAddress & objItem.MACAddress & "#"
Next
strMACAddresses = Split(strMACAddress,"#")
Set colNetCard = objWMIService.ExecQuery ("Select * From Win32_NetworkAdapterConfiguration where IPEnabled=TRUE")
For I = 0 to UBound(strMACAddresses)
For Each objNetCard in colNetCard
If objNetCard.MACAddress = strMACAddresses(I) Then
For Each strIPAddress in objNetCard.IPAddress
If InStr(strIPAddress,".") Then
If InStr(arrIPAddress,strIPAddress) = 0 Then Echo strIPAddress
arrIPAddress = strIPAddress & " "
End If
Next
End If
Next
Next


Edited by WindowsStar - 6 hours 60 minutes ago at 5:00am

Viewing all articles
Browse latest Browse all 10386

Trending Articles