Q: How can I use Windows PowerShell to find a specific network adapter object in Windows Server 2012?
Find a network adapter object in Windows Server 2012.
John Savill
May 17, 2012
1 Min Read
A: Most Windows PowerShell cmdlets use objects for commands, so if you know the MAC address of a network adapter the easiest way to find the right network adapter object is use the following command:
PS C:> Get-NetAdapter | where {$_.MacAddress -eq "90-E2-BA-06-F9-D6"} Name InterfaceDescription ifIndex Status MacAddress Link Speed ---- -------------------- ------- ------ ---------- -- VM Team - Default Microsoft Network Adapter Multiplexo... 26 Up 90-E2-BA-06-F9-D6 ps Wired Ethernet Connec...3 Intel(R) Gigabit ET Dual Port Server... 23 Up 90-E2-BA-06-F9-D6 ps
This could be assigned to a variable such as the following:
$NIC1 = Get-NetAdapter | where {$_.MacAddress -eq "90-E2-BA-06-F9-D6"}
One thing to remember, though, is that Windows Server 2012 supports Consistent Device Name (CDN), which means the CDN of the NIC can be used as specified in the server configuration, which is by far the easiest option.
For more FAQs about Group Policy, System Center, Windows 8, virtualization, and more, go to John Savill's FAQs.
About the Author
Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.
You May Also Like