Auto-Shutdown Hyper-V free with UPS

Auto-Shutdown Hyper-V free with USB UPS

This post is about how to Auto Shutdown Hyper-v core with UPS using PowerShell and also send email notifications based to UPS battery level.

Recently i installed a Windows Hyper-V 2012 R2 server (the free version) but my UPS doesn’t support Windows Core. No problem, we have PowerShell!! after some search on various sites – blogs – etc i end up creating the following script. It checks the battery status every 3 minutes, using WMI and when the battery drops below 50% is sends the shutdown signal. As long as you set the VMs to save on shutdown you are OK!

I also added a simple mail notification before the shutdown.

Feel free to use my script and also edit at will based to your needs

Share

Leave a Reply