Collection for computers that failed to run an advertisement

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

image

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’

By | 2010-05-27T07:58:36+00:00 May 27th, 2010|Configuration Manager (SCCM), General info|3 Comments

About the Author:

Kent Agerlund
Microsoft Regional Director, Enterprise Mobility MVP. Microsoft Certified Trainer and Principal consultant. I have been working with Enterprise client management since 1992. Co-founder of System Center User Group Denmark in 2009. Certified MCITP: Enterprise Administrator, MCSA+Messaing, and much more. Member of: Microsoft Denmark System Center Partner Expert Team The Danish Technet Influencers program System Center Influencers Program.

3 Comments

  1. Jay October 6, 2011 at 20:23 - Reply

    I’m pasting this query into the query language window but it’s telling me the query is invalid. Am I missing something?

  2. Kent Agerlund October 6, 2011 at 20:25 - Reply

    Might be the quotes around the advertisement and Succeded (‘A0120005′ and LastStateName = ‘Succeeded’) that you will need to change

  3. en marcha June 13, 2014 at 5:05 - Reply

    en marcha

    Coretech Blog » Blog Archive » Collection for computers that failed to run an advertisement

Leave A Comment