So there was a question over at the VMware community forums on how to enable / disable maintenance mode on objects with a script… as this is something I was planning to do anyway I decided to script it for myself and share it with the community…

There are several options… Maintenance Mode by specifying a date / time, Maintenance Mode by specifying minutes and  Manual Maintenance mode where you have to enable and disable with the script…

Below is a screenshot of a VirtualMachine in the vRops 6.6 GUI that has Maintenance Mode enabled.

Below is a screenshot of a VirtualMachine in the vRops 6.6 Suite-Api that has Maintenance Mode enabled. (DateTime or Minutes)

Below is a screenshot of a VirtualMachine in the vRops 6.6 Suite-Api that has Manual Maintenance Mode set.

 

And now to the script…

You will need to create the credentials file within the config folder which will be used to access vRops Suite-API and create a log file @ \Log\Logfile.log

Then you can use the script below with the different parameters… for example….  datetime, minutes, Enter-MM or Exit-MM.

Hope this helps…

vMan