Powershell - Listar Hosts con VMotion enabled


Add-PSSnapin VMware.VimAutomation.Core
connect-viserver -server QE50.CL.QE.LAB -user qecl\rojasa-c -password Control123 -port 443

$esxhosts = Get-VMHost
foreach ($esxhost in $esxhosts)
{
   $vmHostNetwork = Get-VMHostNetwork -VMHost $esxhost
   $vmHostNetwork.VirtualNic | foreach {
            if ( $_.VMotionEnabled -eq "True" )
            {
                $esxhost.Name
            }
  }
}

Comentarios