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
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
Related Articles, References, Credits, or External Links
NA