Getting a quick overview of networking in Hyper-V

A little while ago I talked about how Hyper-V in Windows 8 / Windows Server 2012 allowed you to see the IP address of a virtual machine through Hyper-V Manager.

Well, with the release preview / release candidate build you can now take this a step further and use PowerShell to get a quick overview of how IP addresses are configured for an entire Hyper-V server:

image

With the following command:

Get-VM | Get-VMNetworkAdapter | ft VMName, MacAddress, IPAddresses

Or for multiple Hyper-V servers:

image

With this command:

Get-VM -ComputerName benarm-alpha, benarm-beta | Get-VMNetworkAdapter | ft ComputerName, VMName, MacAddress, IPAddresses

(where benarm-alpha and benarm-beta are the names of the servers I was looking at)

This is very handy when you are trying to get an “all up” view of networking on your system.

Cheers,
Ben

P.S. Yes – something is wrong with my DHCP server and it is not giving out leases to all of my virtual machines, which is why I was running these commands.  It is also why some of my virtual machines currently have 169.254.x.x addresses Sad smile