Recently I got a question from a student who wanted to have two collections for each software deployment. 1 collection containing computer that ran the advertisement successfully; and 1 collection for those who failed.
There can be several ways to solve this puzzle. In my example I look at the status messages coming from the client.
In order to use this solution you first need to find the advertisement ID for the deployment. Navigate to the advertisement and make a note of the advertisement ID. In my example the advertisement ID is A0120005
Next create two query based collections and use these WQL statements:
Collection for a successful installation:
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 = ‘A0120005’ and LastStateName = ‘Succeeded’
Collection for a failed installation:
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 = ‘A0120005’ and LastStateName = ‘Failed’
I’m pasting this query into the query language window but it’s telling me the query is invalid. Am I missing something?
Might be the quotes around the advertisement and Succeded (‘A0120005′ and LastStateName = ‘Succeeded’) that you will need to change
en marcha
Coretech Blog » Blog Archive » Collection for computers that failed to run an advertisement
Still pointing customers at this 8 years later 🙂
[…] Package/program WQL derived from https://blog.ctglobalservices.com/configuration-manager-sccm/kea/collection-for-computers-that-faile…. […]