VMware Cloud Community
tdubb123
Expert
Expert

find VM name by IP address

how do find the VM name with only the IP address of the VM?

0 Kudos
1 Reply
vXav
Expert
Expert

$IPtoSearch = "8.8.8.8"

Get-VM | select name,@{l="IP";e={$_.ExtensionData.guest.net.ipaddress | where {($_ -as [ipaddress]).AddressFamily -eq "InterNetwork"}}} | where IP -like "*$IPtoSearch*"

0 Kudos