Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


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
  • 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

[Webinar] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

Question has a verified solution.

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

More or less everybody in the IT market understands the basics of Networking, however when we start talking about Storage Networks, things get a bit dizzier, and this is where I would like to help.
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
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…

578 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