WQL Query for show the list of systems with two applications installed.

Query to list all the systems with Program A and Program B, use the following query.
Replace Program A and Program B with your application add remove programs display name.
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 where SMS_R_System.ResourceId in (select SMS_R_System.ResourceId from  SMS_R_System inner join SMS_G_System_ADD_REMOVE_PROGRAMS on SMS_G_System_ADD_REMOVE_PROGRAMS.ResourceId = SMS_R_System.ResourceId where SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName like '%Program A%') and SMS_R_System.ResourceId in (select  SMS_R_System.ResourceId from SMS_R_System inner join SMS_G_System_ADD_REMOVE_PROGRAMS on SMS_G_System_ADD_REMOVE_PROGRAMS.ResourceId = SMS_R_System.ResourceId where SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName like '%Program B%')


5 comments:

Tweek said...

I'm tracking down systems with both Adobe Acrobat and Adobe Reader installed, and this is exactly what I needed. Thanks!

Phases said...

Perfect

Roel Janssens said...

Thank you, exactly what I needed!

Anonymous said...

YES, THIS WORKS GREAT. THANK YOU SO MUCH. I'VE BEEN TRYING THIS QUERY FOR A LONG TIME AND FAILED.

Kern McNutt said...

I have been trying to do a query for multiple applications as you have, but where they do not show up in Add/Remove programs (such as Oracle). Any tips on how to do this?

Post a Comment