This tool was written to automate the WSUS server cleanup process.  It can be run in a variety of ways locally and remotely.  If using the tool remotely you need to have the WSUS administrators console installed at a minimum so the WSUS assemblies will be present.

You can run this tool with no parameters and have the utility prompt you for the server name, SSL state and port number or you may specify this information along with your cleanup options as command line parameters.

It would be helpful to create a scheduled task and have it run the tool monthly to keep your WSUS server in a healthy state.

This tool can also run the database maintenance script from, http://technet.microsoft.com/en-us/library/cc708594(WS.10).aspx.  If you choose this option the DB_maint.sql file must be in the same directory as the cleanup tool.

Once the tool completes it will generate a log file with the cleanup results and it will also write the cleanup results to the application event log under the source of "WSUS Cleanup".


=====================================================================================


C:\>WSUS_Cleanup_CL.exe /?
Help menu.

WSUS_Cleanup_CL.exe Server SSL Port [Parameter List]

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

Parameters:
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:
WSUS_Cleanup_CL.exe
             The above command will prompt you to input the server name, SSL configuration and port number WSUS is listening on.  This can be run against a local or a remote server and runs ALL cleanup options.

WSUS_Cleanup_CL.exe SomeServer t 8530 all
             The above command will connect to SomeServer on port 8530, use SSL and cleanup with all options.

WSUS_Cleanup_CL.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).