VMware Esxi rolling reboot after move the host maintenance mode
VMware Esxi rolling reboot after move the host maintenance mode if ($args.count -ne 2) { Write-Host "Usage: rolling_reboot.ps1 <vcenter-nte1.mint> <Host.txt>" exit } # Set vCenter and Cluster name from Arg $vCenterServer = $args[0] $VIHosts = $args[1] # Connect to vCenter Connect-VIServer -Server $vCenterServer -WarningAction Ignore # Get VMware Server Object based on name passed as arg $ESXiServers = Get-Content $VIHosts | %{ Get-VMhost $_ } # Reboot ESXi Server Function Function RebootESXiServer ($CurrentServer) { # Get VI-Server name $ServerName = $CurrentServer.Name # Put server in maintenance mode Write-Host "** Rebooting $ServerName **" Write-Host "Entering Maintenance Mode" Set-VMhost $CurrentServer -State maintenance -Evacuate | Out-Null # Reboot host Write-Host "Rebooting" Restart-VMHost $CurrentServer -confirm:$false | Out-Null #remove the host Write-Host "removing the host" Remove...