Micrsosoft WSUS Cleanup

The Microsoft WSUS server can and has run out of disk space. The appropriate items for updates are selected, the appropriate languages are selected, but in the end the server runs out of space. The native WSUS cleanup wizard doesn’t seem to be of much use when trying to correct this.

Here is a process that I have found and it worked well at least on one WSUS server.

Download and install the following three tools and a Microsoft script.

Open a command prompt with Administrator permissions, navigate to your installation of MSSQL. ie. C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\110\Tools\Binn. The dbfix.sql file is the Microsoft SQL script from above saved at c:\temp.

SQLCMD -E -S np:\\.\pipe\MSSQL$MICROSOFT##SSEE\sql\query /i c:\temp\dbfix.sql > dbclean.txt
SQLCMD -E -S np:\\.\pipe\MSSQL$MICROSOFT##SSEE\sql\query /i c:\temp\dbfix.sql > dbclean.txt
SQLCMD -S np:\\.\pipe\MSSQL$MICROSOFT##SSEE\sql\query /i c:\temp\dbfix.sql > dbclean.txt
SQLCMD -S np:\\.\pipe\MSSQL$MICROSOFT##SSEE\sql\query /i c:\temp\dbfix.sql > dbclean.txt

Run the WSUS_Cleanup_CL.exe tool. Attempts to run this first ended in errors. After running the above SQLCMDs, this tool completed successfully.

WSUS_Cleanup_CL.exe myWsusServerName f 80 supersede expired obsolete compress files DB 2>&1

When complete and from within the WSUS console.

  • Under Options – Update Files and Languages, Remove the check box for download Express Installation files (This is optional recommendation depending on your environment).
  • In the Options – Products and Classifications, select only the needed products.
  • On WSUS console- decline all approved updated which were either installed or not applicable.
  • Delete the WsusContent Folder.
  • Navigate to the C:/program files/updates services/tools on the WSUS server
  • Run WSUSutil.exe Reset

Although I referenced many sources for this, the one that comes to mind is this one.

Source(s)
https://itcalls.blogspot.com/2013/07/how-to-clean-microsoft-wsus-content.html