SQLUndercover / UndercoverToolbox

A collection of cool and useful tools, procedures and scripts for the discerning DBA
https://sqlundercover.com
MIT License
84 stars 40 forks source link

Inspector - Create a new module to track enabled jobs based on a defined list #300

Closed Adedba closed 2 years ago

Adedba commented 2 years ago

Create a new module to maintain a list of Agent jobs that you expect to be enabled.

Agent jobs will be listed in a table that you control allowing you to set whether the job should be enabled or disabled. When a collection runs, the table will be evaluated against msdb.dbo.sysjobs and the current enabled state will be recorded.

When the report runs it will check the table where your desired enabled flag is not equal to the msdb enabled flag and advise.

The job will not actually be enabled this will be for the user to fix but there will be a script in the output for ease.