WSUS Reset and Re-Authorize

Recently I came across  a customer site where a lot of the machines had stopped receiving updates from WSUS, despite being visible in the WSUS console and having shown as reported in.

I decided to write a powershell script to parse all the machines in AD, stop the Windows Update service, delete the SoftwareDistribution folder, restart the window update service, re-register with WSUS and check for updates. This then developed into a GUI driven script with the ability to target specific OUs or individual computers with ease, and added in the option of performing a Group Policy update at the same time.




This should be fairly self-explanatory to use, on first run you will see the box presented above. Pressing the Browse button will bring up the AD OU browser where you can select the OU to target. The selected OU gets copied into the Domain text box on the left (Yes, this needs renaming, I know :P)



Next enter some domain credentials. If you omit the “domain\” part of the username don’t worry, the script will add it when it runs.

if you want to update group policy on the machines as well (maybe you updated the WSUS intranet update location in group policy?) tick the box.

Now hit the Reset WSUS button and go get some coffee. This can take some time depending on how many computers you have. The console window will update you with the progress.

If you only want to target 1 computer, simply click on the individual computer and enter the required details.



I am planning on adding some extra functionality to this at some point, any ideas please leave them in the comments below.




Leave a comment

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