:::: MENU ::::

Please use the below query for creating the collection for Re-run advertisements based on scheduled re-occurrence.

Please use the below query for creating the collection for Re-run advertisements based on scheduled re-occurrence (This query will remove re-run advertisement installation succeeded machines from collection automatically)

 

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_ClientAdvertisementStatus JOIN

SMS_R_System ON SMS_R_System.ResourceID = SMS_ClientAdvertisementStatus.ResourceID

WHERE (SMS_ClientAdvertisementStatus.AdvertisementID =’Master Advertisement ID’)

 

AND

(SMS_ClientAdvertisementStatus.LastStateName=’Failed’

OR

SMS_ClientAdvertisementStatus.LastStateName=’Accepted – No Further Status’

OR

SMS_ClientAdvertisementStatus.LastStateName= ‘Retrying’

OR

SMS_ClientAdvertisementStatus.LastStateName= ‘Waiting’)

AND

SMS_R_System.ResourceID NOT IN(SELECT SMS_ClientAdvertisementStatus.ResourceID FROM SMS_ClientAdvertisementStatus

WHERE SMS_ClientAdvertisementStatus.AdvertisementID =’Re-run Advertisement ID’

AND SMS_ClientAdvertisementStatus.LastStateName =’Succeeded’)


So, what do you think ?