Search code examples
powershellvmwarepowercli

PowerCLI - Finding Virtual Machine via VM IP


I am trying to locate specific VM's based from IP addresses in PowerCLI. I found this script online Grabbing VM ipaddress via PowerCLI

The intial question explaines the issues I was having, and the answer looks to resolve such issues, however when I run such script:

Get-View -ViewType VirtualMachine | Select @{N='IP';E={[string]::Join(',',$_.Guest.net.IPAddress)}}

All I get is the following output:

IP
--

And that's it... Am I missing input such as specifying a cluster or DC, does this work for anyone else?


Solution

  • Although I'm not sure why the above still doesn't work, i found the following that may help people. Very useful for Large VM enviroments. (This is what I was trying to script from the above initially).

    Using PowerCLI to Find a Specific Guest IP