Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 230663

Re: Find VM via IP

$
0
0

I managed to find a way to do this sort of. The idea I'm using at the moment that "works" somewhat, just gotta do some additional manipulation since I get arrays and properties back for IP. I'd still be interested in getting code that filters at the vCenter level if possible.

 

Here's my final code at the moment:

 

$input = icsv "input.csv"
$list = @()
foreach ($row in $input) {    $VM = Get-View -ViewType VirtualMachine | Select Name, @{N="IP";E={$_ | `        Select -ExpandProperty Guest | `        Select -ExpandProperty Net | `        Select -ExpandProperty IpAddress}} | `        Where {$_.IP -contains $row.IP}    $list += $VM
}  
$list

 

~Brandit


Viewing all articles
Browse latest Browse all 230663

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>