SCCM How to find out the status of Predefined Maintenance Tasks

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 How to find out the status of Predefined Maintenance Tasks
SCCM How to find out the status of Predefined Maintenance Tasks

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)

Patch My PC

Anoop is Microsoft MVP! He is a Solution Architect on 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, Intune. He writes about technologies like ConfigMgr, Windows 11, Windows 10, Azure AD, Microsoft Intune, Windows 365, AVD, etc.…

6 thoughts on “SCCM How to find out the status of Predefined Maintenance Tasks”

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.