I manage several SBS 2008 and SBS 2011 servers. One of the key maintenance issue is the size of the WSUS database. There are plenty of posts from people bemoaning the fact that suddenly the WSUS Content folder has grown to over 20gb (or more)!
WSUS provides an easy way to run the wizard manually. But doing this requires one to log into the server, and start up the wizard. Why do that, when you can schedule the wizard to run on a weekly basis?
Kudos to my good friend and fellow MVP’er, Kevin Royalty, for this information.
STEP 1 – Run the WSUS Cleanup Wizard manually
Before scheduling the wizard to run automatically, it is important to run the wizard manually first, especially if it has not been run in a long time. Do not be concerned if the wizard takes hours (literally) to run the first time. My fellow MVP’er, Philip Elder, blogged that he had one server required 36 hours to do the initial cleanup!!!
Review my post for running the wizard manually.
STEP 2 – Create the WSUS Cleanup Batch file
- Go to the Codeplex site and download the WSUS Cleanup v2 tool (zip file)
- Extract the files to your desired folder (C:\Scripts in my case). Three files are extracted.
- You then need to create your own batch script/command, and documentation to do that is available from the Codeplex site
– OR –
Just download my script (WSUSCleanup.txt) and save it to your Scripts directory (be sure to rename it from WSUSCleanup.txt to WSUSCleanup.cmd)
STEP 3 – Schedule to run the batch file automatically
The only thing left is to schedule the task to run on a regular basis (perhaps weekly on Sunday mornings).
- Click Start –> Administrative Tools –> Task Scheduler
- Click Create Basic Task… from the right hand frame
- Type in a name (for example Weekly WSUS Cleanup)
- Click to run it weekly
- Click to run it every Sunday, and set your time (for example 9:00am)
- Click to ‘Start a program’
- Browse and locate your script (again, as a reminder, if you downloaded my script, be sure to rename the suffix from .txt to .cmd)
- Click to select (enable) the ‘Open the Properties dialog box …’ option, then click Finish.
- Click to select (enable) the ‘Run whether user is logged on or not’ option, then click OK
- You will be prompted to enter the appropriate user account information for running this task.
- I would suggest running the task immediately after creating it and monitor to make sure it runs successfully.