Thursday, 24 September 2026

Monitor your MECM TS provisioning deployments using a single Status Message Query

Introduction

For many many years I have been creating OSD deployment task sequences for clients.  Typically the build engineer will kick off a number of laptops or desktops, or both, and monitor them as they install the corporate build image. They will monitor them right there in the build room.  And that is fine - but what if the build engineer's desk is in another part of the building.  Or what if the third line support engineer is in another building, or even in another country?  If something goes wrong during provisioning, you may want a way of discovering this, and even troubleshooting the problem from your remote location.  This is when the OSD deployment Status Message Query is very useful.

The Built in Status Message Query

Before we start building our custom TS Status Message Query, be aware that there is a built in Status Message Query that can be used.   This is called the All Status Messages for a Specific Deployment at a Specific Site status message query.  This can be accessed by opening the SCCM console, selecting Monitoring\Overview\System Status\Status Message Queries. 



Right click on the query and select Show Messages.  For the Property Value field you will need to enter in the Deployment ID of the deployed Task Sequence.  One way to find this is to navigate to Software Library\Overview\Operating Systems\Task Sequences.  Find the Task sequence you want to monitor and click on Deployments tab in the lower section of the window.  Ensure that the Deployment ID property is selected by right clicking on the upper ribbon under Deployments and then make a note of the Deployment ID.


In this case the Deployment ID is UK120001.  Moving back to our canned status message query we can now enter in the fields.


Clicking on OK will retrieve the status messages from this Deployment ID - which is the Deployment D of a deployment of a Windows 11 task sequence.



So we do have a canned Status Message Query that will allow us to monitor the progression of one deployment for one task sequence.  Typically however, there will be multiple deployments of one Task sequence - for instance I now have two Deployments for my Windows 11 Task sequence - one deployment for Unknown Computers in the case of building a brand new device, and another deployment targeted at a rebuild of a device that is already in MECM.


And what if we would like to monitor the deployments for multiple task sequences by running just one Status Message Query?  For these scenarios we can create the Custom TS Status Message Query.  Use the following steps to create a Custom TS Status Message Query.

Create the Custom TS Status Message Query

The first step in creating your Custom TS Status Message query is to note down the Deployment IDs of all your Task Sequence IDs.  In my MECM test site I have a Windows 11 task sequence with the following Deployment IDs - UK120001 and UK120003.  Also note down your MECM site code - mine is UK1.

Now modify the following query to align with your monitoring requirements:

select stat.*, ins.*, att1.*, att1.AttributeTime from SMS_StatusMessage as stat left join SMS_StatMsgInsStrings as ins on stat.RecordID = ins.RecordID left join SMS_StatMsgAttributes as att1 on stat.RecordID = att1.RecordID inner join SMS_StatMsgAttributes as att2 on stat.RecordID = att2.RecordID where att2.AttributeID = 401 and (att2.AttributeValue = '<DeploymentID1>' OR att2.AttributeValue = '<DeploymentId2>' OR ...) and stat.SiteCode = '<SiteCode>'and att2.AttributeTime >= ##PRM:SMS_StatMsgAttributes.AttributeTime## order by att1.AttributeTime desc

The sections in bold and blue will need to be modified.  In my case, I only have two deployment IDs and so my customized query is as follows:

select stat.*, ins.*, att1.*, att1.AttributeTime from SMS_StatusMessage as stat left join SMS_StatMsgInsStrings as ins on stat.RecordID = ins.RecordID left join SMS_StatMsgAttributes as att1 on stat.RecordID = att1.RecordID inner join SMS_StatMsgAttributes as att2 on stat.RecordID = att2.RecordID where att2.AttributeID = 401 and (att2.AttributeValue = 'UK120001' OR att2.AttributeValue = 'UK120003') and stat.SiteCode = 'UK1'and att2.AttributeTime >= ##PRM:SMS_StatMsgAttributes.AttributeTime## order by att1.AttributeTime desc

Now that the query is configured as required, open the MECM console and navigate to Monitoring\Overview\System Status\Status Message QueriesRight Click and select Create Status Message Query.


The wizard appears.  Enter in a name such as Windows 11 Build and click on Edit Query Statement and then on Show Query Language.  The Query Language Properties window appears.  Remove the existing query and paste in your custom query as created in the above step.


Click on OK and then Next and then Next and then Close.

You can now run your new Custom Status Message query and monitor your provisioning builds from any of your MECM administration consoles.

Conclusion

Oftentimes a build room is without windows, and even a few floors below ground level.  They can be noisy and unpleasant places.  Using the steps in this article there is no reason you cannot monitor and troubleshoot your OSD provisioning builds using a custom status message query from a remote location.  Remember to add any additional deployment IDs into the query whenever they are created.  I hope you have enjoyed reading this little article and I hope you enjoy running this great little status message query whenever you are provisioning devices for your customers.

No comments:

Post a Comment