Finding All VMs with Multiple IPv4 Addresses
Finding All VMs with Multiple IPv4 Addresses
Here’s a quick PowerCLI one-liner. I recently had to find all of the VMs in a customer’s environment that had multiple IPv4 IP Addresses assigned to them. Here’s the command that I ended up using: Get-VM | Get-VMGuest | select VM, IPAddress | ? {($_.ipaddress = $_.ipaddress | ? {$_ -match ‘\.’ -and !($_ -match ‘^169\.254\.’)}).count -gt 1} That guy’s a little dense, so lets break it down. Get-VM gives me a list of all VMs in the environment, which is piped to Get-VMGuest which returns the VM…Read More