I needed to delete around 50 scheduled tasks from several machines in Altiris because something went wrong in on of the first jobs.

It would have better if the jobs were configured to fail on error and not continue but they weren’t.

Deleting the jobs from the Altiris console is very, very, slow. First the console asks for confirmation (after showing the hourglass for a long time):

image

Then the actual delete can take a few minutes and then the next server and so on.

I decided to delete the tasks directly from SQL.

I know this is not preferred but I think in the end it’s safe enough because I found a stored procedure called del_event_schedule which looks like this:

So al it does is a (transacted) delete from the table.

 

First I created a query that selects the current scheduled tasks:

This selects the computer name and task name for all computers that match VCTXA070% that have not yet started (status_code is null).

The start_time check prevents deleting recurring tasks like this one:

image


Since this gave me the correct results I deleted them:

If you want to delete completed tasks as well you can just leave out the status_code check: