Old Tasks will not Delete - no delete option in the right-click menu
book
Article ID: 172958
calendar_today
Updated On:
Products
Task ServerIT Management SuiteClient Management Suite
Issue/Introduction
The customer is trying to delete old tasks from his SMP Console. However, there is not right-click>delete option.
Environment
ITMS 8.x
Cause
This is due to orphaned instances of the task remaining in the database.
Resolution
To ensure full deletion, walk through these steps:
On the main window for the task, click on one of the scheduled instances shown, and then press Ctrl + A.
Click the red delete X icon and choose to delete all the instances. If there are a lot of instances, it will tell you that the deletion will happen asynchronously.
Right-click on the task and choose Properties. Copy the GUID under the General tab (last field) for use in the following queries.
Open SQL Studio Manager and open a Query window.
Run the following query, and replace <GUID> with the GUID copied above: INSERT INTO ItemToDelete
VALUES ('<Guid>', GETDATE())
Run the following query, and replace <Guid> with the same GUID copied above: SELECT TaskVersionGuid
FROM [dbo].[ItemVersions] iv
JOIN [dbo].[TaskInstancesIncomplete] ti ON iv.VersionGuid = ti.TaskVersionGuid
WHERE iv.ItemGuid = '<Guid>'
AND ISNULL(ti.InstanceStatus, 0) IN (0, 1, 4)
Take the GUID that is returned in the above query and run the following query: DELETE FROM TaskInstancesIncomplete
WHERE TaskVersionGuid = '<Guid>'
In Microsoft's Task Scheduler, find and run the NS.Quarter Hour schedule.
The task will now be deleted. Repeat for other tasks as necessary.
If the above steps didn't work for you, please refer to KB 162337 "Unable to load or delete corrupted tasks"