A couple of MEMCM Collection Queries


Here’s a quick blog post to give you a couple of collections queries based on the status or description of a deployment.

For example, you might want to target devices based on the returned Message ID or StatusDescription and using these criteria will help you with this.

Query based on MessageID

select SYS.ResourceID,SYS.ResourceType,SYS.Name,SYS.SMSUniqueIdentifier,SYS.ResourceDomainORWorkgroup,SYS.Client from sms_r_system as sys inner join SMS_ClientAdvertisementStatus as offer on sys.ResourceID=offer.ResourceID WHERE AdvertisementID = '<AdvertisementID>' and LastStatusMessageID = <MessageID>

Query based on StatusDescription

select SYS.ResourceID,SYS.ResourceType,SYS.Name,SYS.SMSUniqueIdentifier,SYS.ResourceDomainORWorkgroup,SYS.Client from sms_r_system as sys inner join SMS_ClassicDeploymentAssetDetails as offer on sys.ResourceID=offer.DeviceID WHERE DeploymentID = '<DeploymentID>' AND StatusDescription = "<StatusDescription>"

Insert your values in the fields marked with < >

Hope these help

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s