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

Re: Locating a VM without vCenter?

$
0
0

if you are looking for a particular VM, you can use a PowerCLI script like below

 

$hostlist = "esxihost1" , "esxihost2", "esihost3"

 

$hostlist = Read-Host "Enter the name of the VM:"

 

$hostlist| %{

    $dummy = Connect-VIServer -Server $_  -User  -Password

    if(Get-VM -Name $vmName -ErrorAction SilentlyContinue){

        Write-Host "VM" $vmName "found on" $defaultViServer -ForegroundColor Green

                   Disconnect-VIServer -Confirm:$false

                   break

    }

    Disconnect-VIServer -Confirm:$false

}


Viewing all articles
Browse latest Browse all 225804

Trending Articles



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