Unstick a remote reboot

Here’s a useful tip if you’ve ever tried performing a remote reboot of a server or workstation running Windows and had the reboot get hung up.

First, some background: you can remotely reboot a machine with the following command:

shutdown /r /m \\computername

Of course, you need to be running as a user with admin rights on the remote machine. Typically, I would follow this with a ping -i computername to confirm the remote machine has rebooted.

Normally, after a minute or two, you’ll see the machine stop responding to ping, and then eventually come back online. Occasionally, though, if the remote machine is having issues, the reboot can get hung up. If you try the command again, you will get the error: A system shutdown is in progress.(1115).

What now? Well, you can try cancelling the reboot with shutdown /a /m \\computername and initiate it again. You might try adding the /f switch to the shutdown /r command, which forces all running applications to exit rather than allowing them to save their data. But what if that doesn’t work either?

PSKill to the rescue. This tool is part of the excellent PSTools suite. Just unzip them to a folder in your path (like C:\Windows). We’re going to take advantage of a useful property of the Windows kernel: it depends on certain processes to be running at all times, and if one of these processes is terminated, the system will immediately reboot. One of these processes is winlogon.exe. Just issue this command:

pskill \\computername winlogon

Note that this is nearly the equivalent of pulling the plug on the machine. I wouldn’t recommend using it unless a regular reboot has failed. And of course if the machine isn’t responding to RPC, then nothing is going to work and you’ll just have to walk over there and mash that power button.

Was this helpful? Know of a better way? Leave a comment and let me know!


Posted

in

by

Tags:

Comments

20 responses to “Unstick a remote reboot”

  1. Ryan my man – thank you very much, just worked like a charm on a stuck Windows 2003 R2 Standard 32 bit server. Much appreciated!

  2. Steve

    Very helpful! Just what I needed to get my stuck Windows 2003 Enterprise 32 bit server reboot completed. Thanks a million!

  3. arun

    worked really well – thanx

  4. Perry White

    Saved my neck! I had no physical access for hours, was getting very nervous!

  5. Joe

    save my hind from going into the office at 2am. I owe you a beer. Thanks!

  6. Patrick

    Worked for me! Windows 2003 Standard 2003 Server is 4300KM+ away on the other side of the country. Thanks man!

  7. Matt

    Exactly what I needed! I have used psexec a lot, but didn’t even pay attention to pskill. Thank you!

  8. John

    PSKill worked like a charm where everything else failed.

    THANK YOU VERY MUCH!

  9. Robert

    This was awesome! Never thought to kill the winlogon process. Finally got that stupid server rebooted after hours.

  10. Dan

    Great article, thank you!!

    Now, if you could tell me how to hit F1 remotely during startup!

  11. computername

    Could not start PsKill service on computername:
    A system shutdown is in progress.

    (w2k8 r2)

  12. Hmm, haven’t seen that myself. Maybe try a shutdown /a /m \\computername before running pskill?

  13. Danny Mayhem

    THANK YOU!! Had a fax server that hung on me. Went on site and restarted it but left before waiting to see if it rebooted fully (I know, stupid of me.) Could ping the server but not access it via RDP. Had LogMeIn on it and could get to the Ctrl+ALT+del log in portion but Ctrl+ALT+del did not work. Could not pushing shutdown -r, shutdown -r -f to it. Nothing worked until I found this web page. Again, thank you!

  14. Andrew Duclos

    Awesome post dude! Worked like a charm

  15. klode

    Thanks Ryan for posting this tip.

    It worked the first time I tried it, on a system that had hung during shutdown (while rebooting). Great! Wonderful!

    I tried it a second time then the system was running normally. That was a bad idea because it caused a BSOD complaining that winlogon had died :-/. I had to wait until someone could stand in front of the system to power cycle it.

    Lessons learned:
    1) Always try shutdown (or psshutdown) first. Use psskill on winlogon only if the system is otherwise unresponsive.
    2) Where budget allows, use a remote power cycle unit such as the NPS-3F15-1 Network Power Switc (https://www.wti.com/p-268-nps-3f15-1-network-power-switch-pdu-15a-120v-3nema-5-15r.aspx).

    –klode

  16. Hosam

    U R the best. you saved me…
    Thanks

  17. Babun

    Very nice 🙂 I don’t know if pskill uses wmi or not, but some pstools use a different api and you can try killing processes through wmi api also if this doesn’t work with a tool like the built-in wmic

    Something like wmic /node:computername process where “name like ‘winlogon.exe’” call Terminate

    Might be the same wmi call though, i can’t say

  18. justsomedood

    pskill \\computername lsass. Been using it since the Sasser days..

  19. me

    Nothing I have tried works. pskill of either lsass or winlogon, rdp just fails (it shows dialog and goes away so fast I don’t see anything when I try), and shutdown reports the 1115 error. Short of power cycling, I have run out of options I can think of.

    Thanks for this regardless!

  20. Shujah Das Gupta

    Worked like a charm! Thanks a bunch!!