VMware Cloud Community
hugopeeters
Hot Shot
Hot Shot

$vm.Guest.IPAddress only shows one address

For vm's with multiple NICs and therefore multiple IP addresses, the value of $vm.Guest.IPAddress only contains one of the two IP addresses.

($vm = get-vm "vm name")

All IP addresses can be found by using ForEach ($NIC in $vm.Guest.Nics){$NIC.IPAddress}

Reply
0 Kudos
1 Reply
Niket
Enthusiast
Enthusiast

Hi,

If multiple IP addresses had been assigned to a vm, guest.ipAddress or summary.guest.ipAddress will return the primary IP address assigned to the guest operating system.

Other way to get the list of all IP address of a vm by using guest.net which returns array of GuestNicInfo, holding guest information about the network adapters.ipAddress property returns the IP addresses of the adapter.

I hope it helps you.

Thanks

Niket

Reply
0 Kudos