0

We have one windows Server 2008 R2 installation and we need the power button to trigger the server's shutdown procedure.

Generally this works as expected, but when there's a blocked session the shutdown does not happen.

I have googled this requirement wide and far, but I have been unable to find anything related.

Bruno9779
  • 1,551
  • 2
  • 14
  • 31

1 Answers1

0

You could use the Windows Task Scheduler to create a task triggered by the power button event (I'm not sure about the EventID, perhaps 109 or 1074).

The task will call the shutdown command:

shutdown /s /d p:0:0
  • /s shutdown command to the local computer
  • /d this records the reason for the shut down (p is planned and 0:0 indicates an "Other" reason)
manlio
  • 18,345
  • 14
  • 76
  • 126