Hyper V: Get All The Guest VM IP Addresses

KB ID 0001386

Problem

Getting the IP address for an individual guest VM is easy enough, but if you have a lot of guest VM’s then you need some PowerShell.

Solution

To get the IP’s of all the Guest VM’s on an individual Hyper-V host, use the following syntax;

Get-VM | Select-Object -ExpandProperty NetworkAdapters | Select-Object VMName,IPAddresses | Format-Table -Auto

Get Hyper V VM IP Addresses

Note: The entries with no IP, are either powered off, (or are VM replicas).

But if you have a Hyper-V cluster, you would have to do this on every host. Or you can use the following syntax;

Get-VM -ComputerName (Get-ClusterNode)| Select-Object -ExpandProperty NetworkAdapters | Select-Object VMName,IPAddresses | Format-Table -Auto

Get All Hyper V VM IP Addresses in a cluster

Related Articles, References, Credits, or External Links

NA

Author: PeteLong

Share This Post On

Submit a Comment

Your email address will not be published. Required fields are marked *