Powershell – Windows Update Client Sledgehammer aka Reset-WUClient

The following code forces a reset/repair of the Windows Update Client on a device. It  is based on https://support.microsoft.com/en-us/help/10164/fix-windows-update-errors 

Fixes errors in WindowsUpdate.log


It has some improvements over what else you have probably seen

There are an extra service or two I stop as they can stop the catroot2 folder from being cleaned.

Also for SCCM users, un-comment the local policy file deletion section, as often, this can get corrupted.

It gets rebuilt on reboot and and Software Update Actions are run in the SCCM client




4 thoughts on “Powershell – Windows Update Client Sledgehammer aka Reset-WUClient

  1. You might want to change the Stop-Service to Stop-Service -Force because when I tried your script as-is, I got an error:

    Stop-Service : Cannot stop service ‘Cryptographic Service’ because it has dependent services. It can only be stopped if the Force flag is set.

    • Thanks d3xt3r, That’s not normal. Unfortunately the script does not handle stop services commands well. What I have found is that if I have an error whilst stopping the services, it either means its is in the middle of doing something OR the service has an underlying fault. I tend to just try again an hour later. But definite using force is an option

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.