Let’s SCCM How to find out the status of Predefined Maintenance Tasks. We often need to know the status of maintenance tasks running on SCCM primary servers as part of troubleshooting. To maintain a healthy SCCM environment, maintenance tasks are critical. SCCM Maintenance Tasks results via PS or SQL.
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:
SCCM Maintenance Tasks SQL Query
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
Resource
How to Check Verify the Status of SCCM Predefined Maintenance Tasks – Check SCCM Predefined Maintenance Tasks Status (anoopcnair.com)
Anoop is Microsoft MVP! He is a Solution Architect in enterprise client management with more than 20 years of experience (calculation done in 2021) in IT. He is Blogger, Speaker, and Local User Group HTMD Community leader. His main focus is on Device Management technologies like SCCM 2012, Current Branch, and Intune. He writes about technologies like ConfigMgr, Windows 11, Windows 10, Azure AD, Microsoft Intune, Windows 365, AVD, etc.…
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
Hi ! – I don’t have any clue about automating all these health check tasks mentioned in Sudheesh’s list.