none
How to fetch the MAC address of the teamed NIC card on Server 2012?

    Question

  • Hi All,

    Can some one suggest me programmatically how to fetch the NIC teaming adapter(Mac address of the teamed NIC card) on Server 2012?
    It would be helpful if you could provide some sample source code or some weblinks which explains the logic to fetch the MAC address of the teamed NIC card on Server 2012.

    Thanks in advance.

    Regards,

    Vinay


    NOTE: We know that we can get the list of adapters using GetAdaptersInfo api. But we  want to list only teamed NIC cards MAC address.
    • Edited by Winikumar Thursday, July 04, 2013 7:51 AM
    Thursday, July 04, 2013 7:23 AM

Answers

All replies

  • Perhaps the MSDN forum would be more responsive. You have landed in general forum and no programming is expected here.

    Thank you for understanding

    Milos

    Thursday, July 04, 2013 7:38 PM
  • PowerShell

    $output = Get-NetAdapter <teamednic>

    $output.macaddress will contain the MAC address.

    And, if you want to get the information without knowing the names of the NIC teams, you can use the Get-NetAdapter to return a list of all adapters and then you select the ones with .InterfaceDescription containing 'Microsoft Network Adapter Multiplexor' and use the .macaddress for each of those.


    .:|:.:|:. tim

    Thursday, July 04, 2013 7:44 PM
  • Thank you.

    Can't the Network Interface Description change?

    Because as per the below link it is changeable:

    http://technet.microsoft.com/en-us/library/cc787332%28v=ws.10%29.aspx

    If it gets changed, the above mentioned method might not work.

    Regards,

    Vinay

    Friday, July 05, 2013 10:02 AM
  • Hi,

    Thank you for the post.

    You can use GetAdaptersInfo  to get MAC address as per: http://msdn2.microsoft.com/en-us/library/aa365917.aspx

    Regards,


    Nick Gu - MSFT

    Monday, July 08, 2013 6:43 AM
    Moderator