Shutdown full VMware datacenter on UPS failure

To shutdown a VMware datacenter on UPS failure i found a PowerShell script, which i modified:

The script will shutdown the desired VMware datacenter, but it will ask you first, if you are sure. If you like to run the script in silent mode, you can run it with parameter yes.

You have to define the hostname of your VirtualCenter and the name of the datacenter. To run the script, you will need, to have VMware PowerCLI installed.

You can dowload the script shutdownESX.ps1 (right-click -> Save As) or copy/paste it from here:

I’m sure I don’t need to tell you that you need to be extremely careful when testing this script as one false move could shut down everything ! – Please test this to make sure it works first !

Just to mention, this will obviously not work if your virtual center is a VM, for that you will need to do some funky connecting to each host etc, let me know if you desperately need that.

Leave a Reply