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
shutdowncommand:/sshutdown command to the local computer/dthis records the reason for the shut down (pis planned and0:0indicates an "Other" reason)