Link to home
Start Free TrialLog in
Avatar of tom_sc1
tom_sc1

asked on

Hp Nic Teamed Servers - script to return all mac addresses

A portion of the script:
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")

Set colItems = objWMIService.ExecQuery _
    ("Select * from Win32_NetworkAdapter")

Script works fine and returns mac address.  But it only returns the mac address of the virtual NIC.  It does not show the nic of the physical adapters.

Any ideas?
Avatar of Joseph Daly
Joseph Daly
Flag of United States of America image

Have you tried the following using network adapter configuration?
strComputer = "." 
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2") 
Set colItems = objWMIService.ExecQuery( _
    "SELECT * FROM Win32_NetworkAdapterConfiguration",,48) 
For Each objItem in colItems 
    Wscript.Echo "-----------------------------------"
    Wscript.Echo "Win32_NetworkAdapterConfiguration instance"
    Wscript.Echo "-----------------------------------"
    Wscript.Echo "MACAddress: " & objItem.MACAddress
Next

Open in new window

Avatar of tom_sc1
tom_sc1

ASKER

no this still returns only the virtual nic's mac.  It does list out the individual adapters but only lists the virtual mac and not each bia.

Not sure this is possible using vbs

Thanks
I think you may be right. But you may be able to get this info via SNMP. Take a look at the following link.
http://www.brianmadden.com/blogs/guestbloggers/archive/2006/04/19/hp-proliant-network-adapter-teaming-explained.aspx

Search for WMI about 3/4 down the page and you can see there is a MIB file on the smartstart cd you can use to get the MAC addresses of the physical
ASKER CERTIFIED SOLUTION
Avatar of tom_sc1
tom_sc1

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial