Monday, July 19, 2021

PowerCLI to set Evacuated Esxi Hosts into Maintenance Mode

It's the little script that will set all esxi hosts into maintenance mode when no VMs are left running, particularly useful when you're doing the bulk VMs migration or shutdown for Esxi maintenance. You will need to define the script runtime whereas the interval for each check (the action which will loop all esxi hosts to see if VMs are still running or not) should be defined as 15 sec as a minimum.