Find VM Name by IP Address

What do you do when you’ve got a couple hundred VMs in vCenter and you need to find one? If you know its IP address, you can use this nice little PowerCLI snippet. It helped me solve a problem for one of my coworkers.

PS /Users/amkirk> Get-View -ViewType VirtualMachine | ?{ ($_.Guest.Net | %{ $_.IpAddress }) -contains "10.63.172.31" } | select Name

Name
----
csa-rules-server-01032018

-Aaron

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s