System Shutdown Error – Fix Restart-Computer Failed to Restart

powershellwindows-server-2012-r2

I have installed updates on my Windows 2012r2 Machine and as usual, I did a reboot.
However, it seems that the machine has hung itself during the reboot process and does not do a proper shutdown.
I can initiate a connection via RDP, but not connect to the machine, I can also send commands via powershell, so I have tried sending a Force reboot:

Restart-Computer -Force -Credential domain\adminuser -ComputerName COMPUTERNAME

The reply from the server is the following:

Restart-Computer : Failed to restart the computer 10.250.35.16 with the following error message: A system shutdown is in progress.

Is there a way to force the reboot and kill the processes?

Best Answer

I found this helpful.

TASKKILL /S serverIP /U userid /P password /F /IM LSASS.EXE /T
TASKKILL /S serverIP /U userid /P password /F /IM WINLOGON.exe /T

Even when I couldn't connect to the machine with PSTools, I was still able to connect via WinRM using Enter-PSSession and execute these commands locally.

TASKKILL /F /IM LSASS.EXE /T
TASKKILL /F /IM WINLOGON.exe /T
Related Topic