Force reboot of a remote server that has hung shutting down

I had an issue last night when a remote server that I was applying windows updates to, hung while it was shutting down. I will still able to ping the server, and access its file shares, but was unable to get RDP access. I was cursing at this point, with the prospect of a long journey the following day to investigate and bring the server back online. I then considered what other steps I could take to try and force the server to reboot remotely. I used the PSTools command psexec to see if I could still get command line access to the remote server, and fortunately I could. Next I tried to force a reboot of the remote server using psexec and the shutdown command as follows, where REMOTE_SERVER_NAME is the name of the remote server that I was trying to reboot:

psexec \\REMOTE_SERVER_NAME shutdown /r /t 01

alternatively you could use:

shutdown /m \\REMOTE_SERVERNAME /r /t 01

This returned the following error:

1115 A system shutdown is in progress

This basically meant that a system shutdown was already in progress,  and therefore the command was unable to force a reboot. In the end I used the pskill command to stop the winlogon service on the remote server to try and release whichever process wass causing the server to hang on shutdown. I should stress that this was a last resort, and not something that I would recommend doing unless essential:

pskill \\REMOTE_SERVER_NAME  winlogon

Anyway, after another few minutes the remote server did finally restart, although there are a few other things that I should mention that happened in the process. The operating system on this machine was Windows Server 2008 R2. After the server came back up (verified by ping -t REMOTE_SERVER_NAME) I tried to RDP the box again. I was able to enter my credentials and the logon process appeared to start, but after a few seconds the following message appeared on the screen:

Please wait for the Windows Modules Installer

The machine sat like that for quite some time, and then started ‘Configuring Updates’. My RDP session then abruptly ended and the server restarted itself again. Again, when it was back up I tried to RDP the server again and received the ‘Please wait for the windows modules installer message’ for a second time. Thankfully, after a few minutes and another ‘configuring updates’ message, logon continued and ther server was back up and running. On checking the event log and windows update log I was able to verify that all the updates had installed OK, and there were no other errors worthy of note. So in summary, if you want to save yourself a long trip, to most likely press a power or reset switch, you may want to try the above first.    

 

10 Responses to Force reboot of a remote server that has hung shutting down

  1. Mark says:

    Thank you, you have saved me a trip to site on a weekend

  2. Geert says:

    Thank you for the very useful info. By the way, I had to kill the TRUSTEDINSTALLER to get the system to reboot.

  3. Justin Chambers says:

    Awesome work, you just saved me from a 2 hour drive in to work!

  4. Graham Goddard says:

    Excellent suggestion. I ran into exactly this problem, the remote system was partially unresponsive and was clearly not responding to reboot commands. Killing winlogon allowed the reboot to complete/

    Thanks

  5. Thanks for this tip! It worked after I did the TRUSTEDINSTALLER kill as well, as mentioned by Geert up above. Phew!

  6. Bals says:

    I have tried these options, but I am getting the error “The specified server cannot perform the requested operation.”. But server is reachable thru ping.

  7. Jeff says:

    I get the following error message when i try to pskill winlogon.
    Server ping response is positive
    ===============================================

    Couldn’t access :
    The specified network name is no longer available.

  8. Pingback: Force reboot of a remote server | Linewalker Tech Blog

  9. Pingback: Confluence: ITdoc Import

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: