Automate WSUS Cleanup

Windows Server Updates Services is a nice tool that can be used in network deployments that enables network administrators to fine tune their windows patching process. Essentially WSUS creates a local repository of updates that it has downloaded from Microsoft to deploy to client machines. While this is great, the repository depending on what you are updating, can swell in size. Some older installations I have seen are upwards of 20+ GB. WSUS does provide a way to clean the repository of old updates that have been superseded, however that process is a manual one. This is where we can use Powershell once again. Below is a Powershell scipt that can be used as a scheduled task that will automate the WSUS cleanup process. This script can be extended even further by adding email notification using this code.

Did you find this article useful? Why not share it with your friends?

Leave a Reply

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.