Get Virtual Machine IP Address

How do I get the IP address that is displayed in the VI Client for a Virtual Machine?

This is a question that I had today.

$vm = Get-VM -Name "MyVM"
$vm.Guest.IPAddress

Caveats: VMware tools must be installed and virtual machine must be on.

If you would like to get the IP address from Windows VMs that do not have VMware tools installed or you would like to see all the IP address setting then you will need to use wmi and supply sufficient credentials.

Get-WMIObject Win32_NetworkAdapterConfiguration

There are numerous options available, do not forget to read the help and examples.

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.