WSUS: Recreate the base SUSDB on WID and WSUS data [Quick Guide]

8:41 pm April 19, 201714577

I. introduction

in this tutorial, we will see how to start on a clean basis with WSUS, uninstall and reinstall the role. Only by doing a reset of the database and WSUS data.

Since a WSUS database which aged becomes less reactive and especially clutters your server unnecessarily, he may need to do a radical refreshment. Although WSUS includes a cleaning tool which works more or less well, and that sometimes can even crash the console if there is too much data to clean, one realizes that this is not enough.

Although it may seem scary at first, it’s interesting to start from scratch. There will be a preparatory work to rebuild, including the first synchronization, and then wait the time that your computers back in the console, but this refreshment will be necessarily beneficial.

Let’s see how to do this. In this tutorial, I use a WSUS under Server Windows Server 2012 R2, with a data base Windows Internal Database (WID). The procedure is slightly different if your WSUS uses a database on SQL Server. Nevertheless, this procedure works on Windows Server 2012 identical, however I have not tested on Windows Server 2016 but I am taking back 🙂

II. Stop the WSUS services

from a console PowerShell open as that administrator, stop both services related to WSUS:

 Service Stop WSUSService, W3SVC 

you can check that they are well stopped with the following command:

 Get-Service WSUSService, W3SVC 

see for yourself:

III. Back up the SUSDB database

before deleting the SUSDB database, which is the name of the database corresponding to WSUS, we will perform a backup . For this, we will use SQL Server Management Studio it takes to download the corresponding version

Note: If you are unsure if the WSUS server uses a WID or SQL Server database, you can look at the value “ SqlServerName ” in the registry within this key: HKLMSoftwareMicrosoftUpdate ServicesServerSetup

logically on Windows Server 2012 R2 You must install the Management Studio of SQL Server 2012 version. To be sure this choice, navigate to the folder “ C:WindowsWIDLog ” and open the file “ error.log “.

As you can see below, the first line of the file gives you information on the version of SQL Server 2012 (although the database is WID). Download and install the SQL Server Studio adequate Management.

Installation of basic management tools is sufficient:

once the installation is complete, you can open SQL Server Management Studio as an administration (otherwise it won’t work). Enter the following string as the server name and initiate the connection:

\.pipeMICROSOFT##WIDtsqlquery

Comme this:

then on the left, pull down “ databases ” and “ SUSDB ” right-click then “ new query ” so that it runs the backup query.]

Run the following query in adapting the path to which you want to store the backup if necessary.

 backup database [susdb] to disk = 'D:Backupsusdb.bak' with copy_only 

click on the button “ run ” to run the SQL query.

After a few minutes, the backup should terminate and you will get a message similar to this one:

IV. Remove the SUSDB database

it continues our work by removing the SUSDB database through SQL Server Management Studio. Right-click on the SUSDB database and click on “ delete “.

Before posting the deletion, check the option “ closing existing connections ” then click on “ OK “.

V. Remove WSUS data

now that you got rid of the WSUS database, we will remove the WSUS database. First delete the folder corresponding to these data, usually in a folder named “WSUS” stored on a dedicated volume:

 Remove-Item - Path D:WSUS - Recurse 

then re-create an empty directory:

 Set - Location D:New-Item - ItemType Directory - Name "WSUS" 

think of course adapt the path.

VI. getting started with WSUS

stretch in WSUS reset: Let’s start the two services that you had previously stopped:

 Start-Service WSUSService, W3SVC 

which gives:

in conclusion, let’s initialize the creation of the SUSDB basis to complete the refurbishment. Here is the associated command:

.Wsusutil.exe postinstall CONTENT_DIR = "D:WSUS" 

think to position yourself in the directory where Wsusutil.exe is:

 Set-Location "C:Program FilesUpdate ServicesTools" 

after a few minutes, the post-installation process ends.]

The rest is to start the WSUS console and then follow the Setup Wizard, I leave you in the company of the console of WSUS know perfectly and to reconfigure to start on a sound basis.

Good luck! 🙂