How to Fix Windows Server 2012 R2 Update Stuck at 9% After Restart with IIS/SQL Server Installed


4 views

Dealing with a Windows Server 2012 R2 update freezing at 9% post-restart is particularly common when the server runs Microsoft stack components like IIS, SQL Server, or TFS. The system enters an update loop where neither normal boot nor Safe Mode helps.

This typically occurs when:

  • Update components conflict with running services
  • Pending operations from previous installations exist
  • System resource allocation hits a deadlock

Try these commands via WinRE (Windows Recovery Environment):

# Check pending operations
dism /image:C:\ /get-packages

# Clean update cache  
net stop wuauserv
net stop cryptSvc  
net stop bits
net stop msiserver
ren C:\Windows\SoftwareDistribution SoftwareDistribution.old
net start wuauserv
net start cryptSvc
net start bits  
net start msiserver

When basic methods fail, we need deeper intervention:

# Repair component store
dism /online /cleanup-image /restorehealth

# Force reset Windows Update components
Push-Location $env:systemroot\system32
foreach ($file in (Get-ChildItem *.dll)) {regsvr32 /s $file.name}  

Download the specific KB update package from Microsoft Catalog, then:

wusa.exe X:\path\to\update.msu /quiet /norestart
shutdown /r /t 0

For servers running SQL/IIS, always:

  • Create system restore points before updates
  • Use WSUS for controlled deployments
  • Maintain bootable recovery media

When deploying Windows Server 2012 R2 with common enterprise components like IIS, SQL Server, and Team Foundation Server (TFS), many admins encounter the infamous update stall at 9% during post-reboot installation. This typically occurs after running Windows Update and accepting the restart prompt.

First, attempt these recovery methods in sequence:

  1. Hard reboot 3 times to trigger Automatic Repair
  2. From recovery console, run these commands:
    dism /image:C:\ /cleanup-image /revertpendingactions
    sfc /scannow /offbootdir=C:\ /offwindir=C:\Windows
    
  3. If accessible, delete pending.xml:
    del C:\Windows\WinSxS\pending.xml
    

For systems with SQL Server installed, additional steps are often needed:

# Check for SQL Server update conflicts
Get-ChildItem "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\Packages" | 
Where-Object { $_.Name -match "sql" } | 
ForEach-Object { Remove-Item $_.PSPath -Force }

When all else fails, use this PowerShell sequence to force cancel the update:

Stop-Service -Name wuauserv -Force
Remove-Item "C:\Windows\SoftwareDistribution\Download\*" -Recurse -Force
Remove-Item "C:\Windows\WinSxS\pending.xml" -Force -ErrorAction SilentlyContinue
Start-Service -Name wuauserv

Before applying major updates on production servers:

  1. Create a checkpoint/snapshot
  2. Stage updates using this PowerShell script:
    $Updates = Get-WindowsUpdate -MicrosoftUpdate -NotCategory "Drivers"
    $Updates | Install-WindowsUpdate -AcceptAll -AutoReboot:$false
    
  3. Always install .NET Framework updates separately