Finding All VMs with Multiple IPv4 Addresses

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


VMware Social Media Advocacy

Leave a Reply

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

Discover more from VCDX #181 Marc Huppert

Subscribe now to keep reading and get access to the full archive.

Continue reading