Reset WSUS SUSDB and Content folder

Follow the below steps to completely rebuild WSUS from scratch

Stop the WSUS Services

Launch CMD and run the below to stop all the services

net stop W3SVC && net stop WsusService && net stop WSusCertServer

Create the SQL Script to backup the existing database then drop

Save the below using notepad as ResetWSUS.sql

BACKUP DATABASE [SUSDB] TO DISK = N’c:\temp\susdb.bak’ WITH NOFORMAT, NOINIT, NAME = N’SUSDB-Full Database Backup’, SKIP, NOREWIND, NOUNLOAD, STATS = 10

GO

ALTER DATABASE SUSDB SET OFFLINE WITH ROLLBACK IMMEDIATE; DROP DATABASE SUSDB;

GO

Backup and Drop the database

Open CMD and Administrator and run. This assumes you have previously installed the WSUS prerequisites from here.

sqlcmd -S \.\pipe\MICROSOFT##WID\tsql\query -i c:\temp\ResetWSUS.sql

Delete the database files

Open CMD and Administrator and run.

del /Q C:\Windows\WID\Data\SUSDB.*
del /Q C:\Windows\WID\Data\SUSDB_.

Delete the WSUS folder

Substitute D:\WSUS for your folder location

rmdir /Q /S D:\WSUS

Reconfigure WSUS SUSDB and Folders

Open CMD and Administrator and run.

net start WsusService && net start WSusCertServer

“C:\Program Files\Update Services\Tools\wsusutil.exe” postinstall CONTENT_DIR=”D:\WSUS”

If you found this article helpful, would you consider buying me a Coffee?