This package will automatically configure maintenance jobs for your SUP/WSUS/CM database and check recommendations and requirements for WSUS/SUP.

It will configure a job to weekly reindex, defrag of the databases (with the help of Ola Hallengrens scripts) and cleanup WSUS database. The scripts also configures recommendations and requirements for SUP/WSUS, ie check for KB3095113 and required system rights.

 

The scripts does only support one server setup, where SUP, WSUS and ConfigMgr are installed on the same server, at this time.

 

Before you run the scripts

Make sure no Software update synchronization is running at the same time as the scheduled jobs - From Saturday 5 AM to how long it takes for you jobs to run.

I usually configure Software Update synchronization Weekly at Wednesday at 1 AM GMT, if Endpoint protections is in used run the Synchronization daily at the same time and make sure it is done at 5 AM!

When you performed the installation, I recommend to run the scripts manually the first time. This can take hours, and hours, I have seen it running for a day or two. Sometimes it will fail, then you need to run it a couple of time, or run the last resort script to clean up the WSUS database directly. Remember if you never run this it will take hours, hours and probably some more hours. When you done manually once, do it again and again until you see it is rather "quick". Keep in mind to disable SUP synchronization when you run it manually. Also try to not run this the first time during normal working hours, depending on your hardware configuration it may peek your disk, cpu and memory.

 

Procedure to run the scripts

 

10 Check Pre-Requirements.ps1 - Run this with administrative permissions and it will make sure all the pre-req and recommendations are in place. It will do the changes and tell you what it has changed.

20 Configure Services.ps1 - Run this with administrative permissions and it will configure SQLSERVERAGENT to run automatically and make SQL Agent service account member of WSUS Admins and local admin to run all the jobs

30 Installation.sql - This will create a database to store history data

40 MaintainaceSolution.sql - This is Olas script from the top to bottom, the only change is where to store the history data

50 Schedule MaintainaceSolution.sql - This will schedule Olas scripts above, IT WILL NOT ENABLE BACKUP! Weekly saturday at 5 AM and 7 AM

60 WSUS Cleanup Task Scheduled.sql - This will schedule WSUS maintenance Monthly at the first Saturday at 5 PM

 

I hope you don't need this, but there is a way to clean up the updates from the database directly.

99 Last Resort - Cleanup updates.sql

 

Version history

Ver 1.0 - First version with single server setup