January 15th, 2013

PowerTip: Use PowerShell to Quickly Find Virtual Machine Network Adapters

Doctor Scripto
Scripter

Summary: Learn how to use a couple of functions to find quickly virtual machine network adapter information by using Windows PowerShell 3.0.

Hey, Scripting Guy! Question How can I find information about all network adapters used by all virtual machines running Windows Server 2012 with the Hyper-V role?

Hey, Scripting Guy! Answer Pipe the results of Get-VM to the Get-VMNetworkAdapter function, as shown here.

17:34 C:\> get-vm -comp hyperv3 | Get-VMNetworkAdapter

Name            IsManagementOs VMName     SwitchName MacAddress   Status IPAddresses

—-            ————– ——     ———- ———-   —— ———–

Network Adapter False          dc3        external   00155D002D15 {Ok}   {192.168…

Network Adapter False          dc4        external   00155D002D13 {Ok}   {192.168…

Network Adapter False          Ex1        external   00155D002D14 {Ok}   {192.168…

Network Adapter False          server2012 external   00155D002D12        {}

Network Adapter False          web1       external   00155D002D16 {Ok}   {192.168…

 

Author

The "Scripting Guys" is a historical title passed from scripter to scripter. The current revision has morphed into our good friend Doctor Scripto who has been with us since the very beginning.

0 comments

Discussion are closed.