The other posted techniques did not resolve my issue. I had Windows Server 2012 that did not shut down and/or reboot. I have a USB 3.0 connected external drive where connectivity to it became unstable. All attempts to shutdown/reboot the server were futile. After scouring the web and finding nothing that resolved the issue I called Microsoft. The following registry changes “truly resolved” my issue. I hope and would love to know if this helps anyone else. That was done approximately 3 weeks ago and the server is absolutely reliable in every regard. Best practices – make a copy of the registry and/or entries before making changes. All of Microsoft’s proposed changes are being posted as it may be relevant for someone else.
1. Checked the value of (HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management) ClearPageFile at Shutdown
Value is already 0 – so did not make any changes here.
2. Took backup and changed the value of the below registry key:
HKLM >> system >> current control set001>> select control >> WaitToKillServiceTimeout >> Change the value from 5000 to 500.
3. Rebooted the server.