SCCM How to find out the status of Predefined Maintenance Tasks

configmgr sccm  SCCM How to find out the status of Predefined Maintenance TasksOrigin of the Query РIt seems this link is not working now. When I posted this query I was not aware that my colleague was copied it from here. All the credit to the original post owner.

Many times we need to know the status of maintenance tasks running on SCCM primary servers as part of troubleshooting. To maintain, a healthy SCCM environment the maintenance tasks are very important.

Completion Status 0 means the task finished successfully. There is a table called SQLTaskStatus which holds this data. We can also add a column to find the time a task took to run. The query for the same would be:

select *,
floor(DATEDIFF(ss,laststarttime,lastcompletiontime)/3600) as Hours,
floor(DATEDIFF(ss,laststarttime,lastcompletiontime)/60)- floor(DATEDIFF(ss,laststarttime,lastcompletiontime)/3600)*60 as Minutes,
floor(DATEDIFF(ss,laststarttime,lastcompletiontime))- floor(DATEDIFF(ss,laststarttime,lastcompletiontime)/60)*60 as TotalSeconds
from SQLTaskStatus

Posted in: ConfigMgr (SCCM)

4 Comments

  1. bharat says:

    Hi anoop is there any way we can automate this task if yes please let me know how to aceive it.

    http://blogs.technet.com/b/sudheesn/archive/2011/06/08/administartive-checklist-for-configuration-manager-2007.aspx

    Regards,
    Bharat Chand

Leave a Comment and Contact Anoop

Visit Us On TwitterVisit Us On FacebookVisit Us On Google PlusVisit Us On YoutubeVisit Us On LinkedinCheck Our Feed