Wednesday, July 16, 2014

How to create a collection based on a Message ID 11171

At some customer they were asking me how to create a collection in ConfigMgr, based on a Message ID. In this case this must be Message ID 11171, which tells me that systems are deployed successfully. I did a lot of try outs, but none was successful after all. Let's have a look.

In this case some OS deployments are successful, some are in progress, in error, requirements not met, or unknown status. Because the information is in the ConfigMgr database, it must be easy (I guess) to show this information in collections as well. Strange thing is, I couldn't find it on all WQL options available..

After a few tries I did created a query which showed me some information. Unlucky me it showed around 240 systems, where Monitoring status showed me around 650 systems successful. Why not showing ALL systems deployed successfully? Limiting collection was "All Systems" which is limiting to, well.. ALL systems ;)

Let's have a look at the query used:
=========================
SELECT SMS_R_SYSTEM.ResourceID,
  SMS_R_SYSTEM.ResourceType,
  SMS_R_SYSTEM.Name,
  SMS_R_SYSTEM.SMSUniqueIdentifier,
  SMS_R_SYSTEM.ResourceDomainORWorkgroup,
  SMS_R_SYSTEM.Client
FROM sms_R_System  
 JOIN sms_statusmessage ON sms_R_System.netbios_name0 = sms_statusmessage.machinename   
 JOIN sms_StatMsgInsStrings ON sms_statusmessage.RecordID = sms_StatMsgInsStrings.RecordID  
WHERE sms_statusmessage.messageid = "11171" 
AND sms_StatMsgInsStrings.InsStrValue = "The task sequence manager successfully completed execution of the task sequence"

=========================

Does anyone knows how long this information can be used on collection membership? Because both Monitoring status and Reporting services are showing me around 650 systems, this must be possible in collection membership to? Hope to find a WQL query for doing that soon! When possible in WQL options I like to hear it also ;) 

2 comments:

  1. If you click "show query design" this query will give an error. Works fine though.

    ReplyDelete