Unsticking Windows Updates That Are Stuck In Their Tracks

___________________________________________________________________________________________________________________________

IMPORTANT ANNOUNCEMENT FOR OUR READERS!

AskPFEPlat is in the process of a transformation to the new Core Infrastructure and Security TechCommunity, and will be moving by the end of March 2019 to our new home at https://aka.ms/CISTechComm (hosted at https://techcommunity.microsoft.com). Please bear with us while we are still under construction!

We will continue bringing you the same great content, from the same great contributors, on our new platform. Until then, you can access our new content on either https://aka.ms/askpfeplat as you do today, or at our new site https://aka.ms/CISTechComm. Please feel free to update your bookmarks accordingly!

Why are we doing this? Simple really; we are looking to expand our team internally in order to provide you even more great content, as well as take on a more proactive role in the future with our readers (more to come on that later)! Since our team encompasses many more roles than Premier Field Engineers these days, we felt it was also time we reflected that initial expansion.

If you have never visited the TechCommunity site, it can be found at https://techcommunity.microsoft.com. On the TechCommunity site, you will find numerous technical communities across many topics, which include discussion areas, along with blog content.

NOTE: In addition to the AskPFEPlat-to-Core Infrastructure and Security transformation, Premier Field Engineers from all technology areas will be working together to expand the TechCommunity site even further, joining together in the technology agnostic Premier Field Engineering TechCommunity (along with Core Infrastructure and Security), which can be found at https://aka.ms/PFETechComm!

As always, thank you for continuing to read the Core Infrastructure and Security (AskPFEPlat) blog, and we look forward to providing you more great content well into the future!

__________________________________________________________________________________________________________________________

Hello everyone, Matt Novitsch (SCCM Premier Field Engineer) with Craig McCarty (Platforms Premier Field Engineer) here to talk to you about a method of unsticking stuck Windows Updates. We have seen this several times with customers and on our own machines where Windows Updates are stuck downloading, installing, or failing to install for a variety of reasons. We found one way that fixes them all, without having too many steps, and can be done by any administrator…

So what do you need to do? Simple:

  1. Stop the BITS and the Windows Update Services
  2. Delete or rename the SoftwareDistribution folder
    1. NOTE: If deleting, it would be a good idea to copy or backup this folder first
  3. Start the BITS and Windows Update Services.
    1. NOTE: You should now see the SoftwareDistribution folder is recreated

This can be done via script if by running the following in an administrative PowerShell console.

<#

Script Disclaimer. The sample scripts provided here are not supported under any Microsoft standard support program or service. All scripts are provided AS IS without warranty of any kind. Microsoft further disclaims all implied warranties including, without limitation, any implied warranties of merchantability or of fitness for a particular purpose.

#>

#Stop BITS Server

Stop-Service BITS

#Stop Windows Update

Stop-Service wuauserv

#Rename the Software Distribution Folder to .old the folder will be recreated when the services are restarted

Rename-Item -Path “C:\Windows\SoftwareDistribution” -NewName “C:\Windows\SoftwareDistribution.old”

#Start BITS service

Start-Service BITS

#Start Windows Update

Start-Service wuauserv

 

Once this script is done, restart the endpoint and check for updates again.

If you are still experiencing problems with updates you could have a corrupt or missing system file. To resolve this, you will want to run the Deployment Imaging Servicing and Management (DISM) tool followed by SFC /SCANNOW. You can do this by using the steps below.

  1. Open an elevated command prompt
  2. Type ‘DISM.exe /Online /Cleanup-image /Restorehealth /Source:C:\GoodSource\Windows /LimitAccess’ (C:\GoodSource should be replaced with a path to a Windows DVD or mounted ISO).
    *This command can take several minutes to run.
    *In cases where Windows Updates are not broken, you would be able to just run ‘DISM.exe /Online /Cleanup-Image /RestoreHealth’.

    In the screenshot above, I used a ISO mounted to D:\ as my source
  3. When command completes run ‘SFC /SCANNOW’ from the elevated command prompt.

  4. Wait for the verification to show 100% complete. If no errors were detected, then you can close the window and try Windows Update again. If an error was detected and wasn’t automatically repaired, please refer to this article starting at Step 4 in the article.

If you haven’t discovered this method before, hopefully this helps you out of a jam Thanks for reading!