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

Re: How to speed up script? Search VM and virtual networks by VM IP

$
0
0

Try something like this

 

$mask=Read-Host-Prompt 'Enter first 3 octets of IP'

Get-View-ViewType VirtualMachine -Property Name,Guest.IPAddress,Runtime.Host,Network -Filter @{'Guest.IPAddress'="^$mask"}|

select Name,

   @{N='IP';E={$_.Guest.IPAddress-join'|'}},

   @{N=’Cluster’;E={(Get-View-Id (Get-View-Id $_.Runtime.Host-Property Parent).Parent -Property Name).Name}},

   @{N='Network';E={(Get-View-Id $_.Network-Property Name).Name -join'|'}}


Viewing all articles
Browse latest Browse all 49146

Trending Articles



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