Hp Nic Teamed Servers - script to return all mac addresses

Posted on 2010-01-12
Medium Priority
Last Modified: 2012-05-08
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?
Question by:tom_sc1
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
LVL 35

Expert Comment

by:Joseph Daly
ID: 26297036
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

Open in new window


Author Comment

ID: 26297160
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

LVL 35

Expert Comment

by:Joseph Daly
ID: 26297257
I think you may be right. But you may be able to get this info via SNMP. Take a look at the following link.

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

Accepted Solution

tom_sc1 earned 0 total points
ID: 26317593
I ended up logging into each machine and opening the net config utility and copying each bia.  I think HP has a scripting engine that I could have used but sometimes the manual way is easier.  Even if it was 50 servers!

Thanks for all your replys.

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Restoring deleted objects in Active Directory has been a standard feature in Active Directory for many years, yet some admins may not know what is available.
While rebooting windows server 2003 server , it's showing "active directory rebuilding indices please wait" at startup. It took a little while for this process to complete and once we logged on not all the services were started so another reboot is …
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question