How to completely wipe WSUS and start again

Solution 1:

To re-install WSUS with a clean database i.e. no previous configuration:

Run Windows Powershell as Administrator and use the following commands:

  • Uninstall-WindowsFeature -Name UpdateServices,Windows-Internal-Database -Restart

  • Post restart, delete EVERYTHING in the C:\Windows\WID\ (for Win 2012 r2) folder.

  • Then run the following command to re-install WSUS:

    Install-WindowsFeature UpdateServices -Restart
    

This only works on PowerShell 3 or higher.
More info here: Microsoft TechNet: Removing Server Roles and Features

Solution 2:

Answer now found, just posting this for the benefit of anyone else who might come across this problem.

It seems that uninstalling WSUS and WID Database option does not actually remove the WID database.

  • The WID database can be removed by uninstalling the Windows Internal Database feature.

  • You will also need to manually delete the file C:\windows\WID\Data\susdb.mdf before re-installing everything again.


Solution 3:

Use official instructions

There is now an official blog post out:

  • TechNet Blogs: 2016-10-18, Meghan Stewart, Recreating the SUSDB and WSUS Content folder for a Windows Server 2012 based WSUS computer (Archived here.)

This is my unofficial summary of the official blog post:

  1. stop-service WSUSService, W3SVC
  2. connect with SQL Server Management Studio (SSMS).
  3. Use SSMS to backup SUSDB
  4. Use SSMS to delete SUSDB
  5. Rename content directory
  6. Recreate content directory
  7. start-service WSUSService, W3SVC
  8. Run Program Files\Update Services\Tools.Wsusutil.exe postinstall (see blog for command line parameters)
  9. Done.

For WS2012/WS2012R2: Connecting to the Windows Internal Database requires the use of a Named Pipes connection. The connection string you want is:

\.\pipe\MICROSOFT##WID\tsql\query

For WS2003/WS2008/WS2008R2: Connecting to the Windows Internal Database requires the use of a Named Pipes connection. The connection string you want is:

\.\pipe\MSSQL$MICROSOFT##SSEE\sql\query

Tags:

Wsus