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.

Fig: Sample Output

You can download my script here.

This entry was posted in PowerCLI, VMware. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *