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.
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:/s
shutdown command to the local computer/d
this records the reason for the shut down (p
is planned and0:0
indicates an "Other" reason)