Listing all the IP Addresses used by VMs

Listing all the IP Addresses used by VMs

  • Comments 4

Here is a neat little snippet of PowerShell:

Get-VM | ?{$_.State -eq "Running"} |  Get-VMNetworkAdapter | Select VMName, IPAddresses

If you run this on a Hyper-V Server it will give you a listing of all the IP addresses that are assigned to running virtual machines:


This works whether you are using DHCP or Static IP addresses – and can really help when you are trying to track down a rogue virtual machine.


Leave a Comment
  • Please add 3 and 6 and type the answer here:
  • Post
  • Great little tip, Ben. And modifying it by adding -ComputerName to the initial Get-VM command lets you run it against remote hosts.

  • Ben, is there a way to start and connect to VM from rootOS using Powershell?

  • i tried same command it is showing name but it is not showing ip address of virtual machines running. why is that.

  • This doesn't work if the VM is a generation1 VM

Page 1 of 1 (4 items)