WSUS 3.0 SP1 Server Cleanup Wizard via Script

By |2017-12-11T14:49:04+00:00June 2nd, 2011|Azure, Cloud, Windows|0 Comments

We were looking for a way to schedule the WSUS server cleanup wizard recently, as we were running into a few issues with a WSUS server using more disk space than it really needed.

We could get space on the drive via running through the WSUS Server Cleanup wizard in the WSUS MMC, but we wanted a way that we could schedule this in every week to automatically run instead of having to run it manually.

Unfortunately scheduling the WSUS server clean-up wizard is not available natively,  however codeplex have released a tool which is just a simple EXE, that you are able to schedule via task scheduler that will do the same job as the WSUS server cleanup Wizard.

You can download the tool from “

Once you download this copy them to a folder location on the WSUS server and the launch command prompt.

Now map to the folder location and create the script to meet your needs (Examples Below referenced from“)

“WSUSCleanupCL.exe Server SSL Port Parameters

server = WSUS server name.
SSL = ‘t’ if using SSL otherwise ‘f’.
Port = port number WSUS is listening on. Default is ’80’ otherwise ‘8530’.

superseded = cleanup all superseded updates that are no longer needed.
expired = cleanup all expired unapproved updates.
obsolete = cleanup all expired updates regardless of their approval.
compress = cleanup previous revision of updates that are no longer deployable.
computers = cleanup computers that have not contacted the server in over 30 days.
files = cleanup unneeded content files.
DB = runs the database maintenance script (make sure the DB_maint.sql file is present).
all = if all is used all cleanup options above will be run.

Sample commands:
WSUSCleanupCL.exe SomeServer t 8530 all
The above command will connect to SomeServer on port 8530, use SSL and cleanup with all options.
WSUSCleanupCL.exe SomeServer f 80 computers superseded
The above command will connect to SomeServer on port 80, it will not use SSL and cleanup will only run the computers and superseded options (no other cleanup options will run).”

You can schedule this by just putting your command into a batch file and scheduling it to run whenever you like. To confirm the script has worked please check WSUS servers application event log for the below event.


Leave A Comment

like what you see? 

Sign-up to our newsletter and never miss out on the latest blogs, events and tech news from the world of risual
Give it a try, you can unsubscribe anytime.