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.
