Fix: Server Stuck on “Preparing to Configure Windows”

It is not the first time when I come across the following issue in Windows Server 2008 R2 / Windows Server 2012/R2: after the installation of updates or some roles/components, a server prompts to be restarted. Then the message “Preparing to configure Windows. Do not turn off your computer” appears and the server gets stuck for hours. However, the server is accessible, but a number of services, including RDP, are unavailable.

As a rule, in this case the easiest way to solve the problem is to perform server hard reset. For example, you can restart a physical server remotely using HP ILO, Dell iDRAC etc., or using Hyper-V / vSphere consoles (if it is a virtual machine). However, it may negatively affect the OS operation. It is better to use a more “soft” way to reset the server stuck while rebooting.

From another computer using the Services snap-in (services.msc), connect to the stuck server remotely.

In the list of services of the server, it is easy to find Windows Modules Installer in the Stopping state. Obviously, this service prevents the server from performing the correct reboot.

At the same time, the service control buttons are inactive. In the properties of the service, you can find the name of the executable: C:\Windows\servicing\TrustedInstaller.exe