Maintain Your WSUS Server Properly


WSUS maintenance......according to the page at this link: http://technet.microsoft.com/en-us/library/dd939795(v=ws.10)
You are supposed to re-index the database at least once a month.  I know, yet another thing you have to add to your Patch Tuesday woes right :-)  Here is what I have started doing to help maintain our WSUS servers and try to avoid a problem such as this in the future:

Once a month, just  before Patch Tuesday, I re-index the Windows internal database (default option) that I chose to use when setting up WSUS.  To do this on Server2008 R2, you need to:

1.) Install sqlncli_x64.msi and then SQLServer2005_SQLCMD_x64.msi which can be found in the list of packages for "Feature Pack for SQL Server 2005" here: http://www.microsoft.com/en-us/download/details.aspx?id=15748

2.) Grab the sample script given here: http://gallery.technet.microsoft.com/scriptcenter/6f8cde49-5c52-4abd-9820-f1d270ddea61 and save it to a file named WsusDBMaintenance.sql in a known location

3.) Run an elevated command prompt (right click and run-as administrator) and then run the following command: sqlcmd -S np:\\.\pipe\MSSQL$MICROSOFT##SSEE\sql\query –i \WsusDBMaintenance.sql

***Note: this command should be typed in all together and replace with the path to where you saved your script.  Mine would be c:\scripts\wsus\WsusDBMaintenance.sql
****This will create a lot of output to the console, but just note that, aside from any egregious warnings or failure to execute properly at all, you should finally see acknowledgement that the process completed.

4.) Finally, I run the Server Cleanup wizard that removes old updates / superseded updates / computers that haven't contacted the server in over 30 days / etc.

Comments

Popular Posts