Maintaining WSUS 3.0 with scripts

Every month we have more and more updates to download to our servers and the result is more and more space used. This is why we must frequently and automatically take care of our system.

To free some space with the deletion of unused and unneeded updates, exist on TechNet a script and you can automate this step using a scheduled task and a batch file. A sample of bat file is attached.

On TechNet is also available a script to maintain health status of the SUSDB database. As in previous suggestion, I recommend to execute this step with a scheduled task and a command like:
sqlcmd -S “SQL_Server/Instance” -E -i”<Location>Script.sql” -o “<Location>DB_Output.txt”
If you have a SBS server or another system, based on Windows internal database, the correct syntax is:
sqlcmd -S ” np:.pipeMSSQL$MICROSOFT##SSEEsqlquery ” -E -i”<Location>Script.sql” -o “<Location>DB_Output.txt”
This line will establish a trusted connection to SQL Server,execute the script and write all outputs to the DB_Output.txt file. Switches are case sensitive!

This operation will maintain your server in good conditions and always clear, without unneeded updates. I recommend to run this scripts every two or three months, it’s not necessary to run them more frequently.

CleanWSUS.bat (228.00 bytes).

Recommended Reading


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.