get-vmhost HOSTNAME | Foreach {Get-View $_.ID} | Foreach {$_.ShutdownHost_Task($TRUE)}
here is a way to shutdown all the hosts in your vcenter:
#Shut down the host
$currentesxhost = get-vmhost $esxhost
Set-VMhost -VMhost $currentesxHost -State Maintenance
Sleep 55
$currentesxhost | Foreach {Get-View $_.ID} | Foreach {$_.ShutdownHost_Task($TRUE)}
0 comments:
Post a Comment