SMA - Cmdlet for deleting runbook jobs
Update SMA module to include a cmdlet to allow for single or bulk deletion of jobs.
Can you provide a bit more detail about the scenario that you would want to use this for?
Right now, you could change the purge schedule to occur more frequently if your db is filling up too quickly. You can also delete unneeded runbooks which would also delete the associated jobs.
Marc van Eijk commented
Hi Beth, I'm sitting next to Tim typing this comment. The purge job in his environment wasn't being executed because of a permission issue. With this issue solved the bulk deletion of jobs is functioning properly. A more granular purging method would still be an interesting addition to the current stored procedure. For instance to do a purge per smarunbook instead of all jobs. And also provide the option to disable storing job history per runbook in the first place.
I see. Thanks for the explanation Tim!
Tim Pringle commented
The db size is fine, but I this would be handy for :
When im having to go through a set of jobs via smacmdlets that are all of the same status, but some no longer relevant
When im not interested in seeing a history record of a cmdlets jobs for e.g. because it has changed since it was last run and is likely to change several times before being used fully. If i've run a job 15 times yesterday, but the code has now changed and been updated whilst staying the same runbook, previous job info is more than likely not to be relevant information for me.
More than anything, i'd like to option to choose if it's there or not, think waiting on a purge before it becomes removed isn't efficient.