Cleaning up WSUS

Problem:

WSUS is big and full and not happy with you. When you run the WSUS Server Cleanup Wizard, it crashes>

Answer:

(h/t Lawrence Garvin)

This post has been edited for spacing and my notes.

Decline any unneeded updates — this likely will include several thousand Definition Updates. “Unneeded” is defined as any update reported as “100% Installed/NotApplicable” and superseded.

Run the Server Cleanup Wizard to delete expired updates and old revisions. (This may take multiple runs if the SCW times out performing the task, just restart the SCW and let it run some more)

(h/t Bart)

Although you can use the server cleanup wizard, you may want from time to time to clean manually all superseded updates to clean your WSUS infrastructure.

The trick here is to have the column ‘Supersedence’ is visible. Open WSUS console and go to ‘All Updates’. Enable the ‘Supersedence’ column.

image8

Now there are 4 options:

  • No icon: update doesn’t supersede another one nor is it superseded by an update
  •  image11 Blue square on top: this update supersedes another update, these updates you do not want to clean…!!
  •  image14 Blue square in the middle: this update has been superseded by another update, and superseded another update as well, this is an example of an update you may want to clean (decline)
  •  image17 Blue square in the right below corner: this update has been superseded by another update, this is an example of an update you may want to clean (decline)

Note: Always verify that all superseding updates are approved before doing this operation!

Run the Server Cleanup Wizard a 2nd time to delete files freed up by the thousands of updates that were declined in Step #1.

Verify that the Client Detection Frequency is in a reasonable range. (Anything less than six hours is pointless.)

Manually delete any computers in All Computers that are not operational. (The Server Cleanup Wizard can do this for machines out-of-service more than 30 days, but in an SBS environment where you probably know every client system by sight, it might be better to visually verify what’s there and what ought not be.)

Using SQL Server Management Studio, inspect the actual amount of data storage consumed by the data, and compare that to the physical side of the MDF file. If the actual data consumption is less than 80% of the physical database file size, you may get some benefit from shrinking the database file. If there’s <20% free space, though, it’s not worth the effort.

If you can’t see the database, SQL Management Studio Express, put in \\.\pipe\MSSQL$MICROSOFT##SSEE\sql\query as the Server Name.

After shrinking the database, if applicable, stop the SQL Server service hosting the WSUS database and defragment the filesystem hosting the WSUS database.
Restart the SQL Server service and run the WSUS DB Maintenance utility to reindex the database and recalculate table statistics.