Hi,
sometimes you want to find which IP Address belongs to a virtual machine. This can be easily done by powercli, provided that the VMware Tools are installed in each VM.
To find a specifc IP Address
Get-VM * |where-object{$_.Guest.IPAddress -match "10.254.1.34"}
It also works if you just have a part a the Address
Get-VM * |where-object{$_.Guest.IPAddress -match "10.254.1"}
To get a list of all IP Address
$aAllIPs=Get-VM * |%{$_.Guest}|%{$_.IPAddress}
Michael
There is a limitation or bug in BOTH the GUI and the CLI. If a VM NIC has multiple IP addresses, only the first IP is found or reported. This is vCenter 6.5
Seems to be a problem if both IPs are in the similar range, i.e., last octet is .41-.49 (match only matches on the first .4x found, 2nd and subsequent .4y not reported). Example: matches to report .41, but does not report .42