Let's say I have a Windows Server 2012 R2 server with a UPS attached.

Is there a generic way to make Windows Server 2012 R2 shut down when power fails, i.e., the system switches to battery power?

I know that most UPS vendors provide proprietary software to do that, and there are lots of tutorials online on how to configure them. However, I want to create a generic server image that will run on a variety of servers with (possibly) different UPS systems. Is there some way to do that without installing vendor-specific software?

  • Attached like"small setup, USV directly attached via USB / Serial and not network"? – TomTom Jul 25 '14 at 10:40
  • @TomTom: Yes, small setup. – Heinzi Jul 25 '14 at 10:43

This is actually really easy most UPS's support USB and the Battery appears as a standard HID Compliant battery so say Windows sees it (and I assume Linux) as big laptop battery in effect and the standard OS tools will manage it.


No, for the simple reason that the UPS provides the same power to the server regardless of whether it's on battery power or not. The UPS knows if it's on battery power, but thee server does not.

In order to get that information from the UPS, you have to connect to it and interrogate it for that information... but neither the queries nor the responses are standardized across UPS vendors, so you have the either use their custom software, or write up a custom script to handle the different commands and outputs for each vendor (and with some vendors, there are significant differences between models or product lines too).

  • Thanks. I was hoping that there was some standardized protocol, but alas... – Heinzi Jul 25 '14 at 13:16
  • @Heinzi The closest you'll find to that is SNMP, but that's networked rather than direct connected, and there doesn't seem to be much standardization among UPS vendors about what specific SNMP traps they send back in response to a given event... at least not to the point where you can make a reliable one-size-fits-all script (or whatever) to handle it. The much easier approach that I've been using in my current work environment was to settle on a single model of UPS that we can use everywhere wee need a UPS, and that's the only model we buy. – HopelessN00b Jul 25 '14 at 13:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.