Get all Workstations with an Application (WQL)

Purpose: All Workstations with an Application (WQL)

In this example we create a device collection, which gathers all workstations that has a predefined application. This predefined application must be inserted into the query. The first table shows how to gather workstations with an application and not take into account the version number of the application (gathers all versions). The second query has application version restriction as well.


If we use SMS_G_System_INSTALLED_SOFTWARE instead of SMS_G_System_ADD_REMOVE_PROGRAMS we will get both x86 and x64 applications in the same view, else we would need to take into account also the SMS_G_System_ADD_REMOVE_PROGRAMS_64 to get both x86 and x64 applications into the same query.

All Workstations with an Application
Limiting collection: All Systems / All Systems (With Client)
Resource Class: System Resource
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 inner join SMS_G_System_INSTALLED_SOFTWARE on SMS_G_System_INSTALLED_SOFTWARE.ResourceId = SMS_R_System.ResourceId where SMS_G_System_INSTALLED_SOFTWARE.ProductName like “insert your appname here”
All Workstations with an Application and Version
Limiting collection: All Systems / All Systems (With Client)
Resource Class: System Resource
select * from SMS_R_System inner join SMS_G_System_INSTALLED_SOFTWARE on SMS_G_System_INSTALLED_SOFTWARE.ResourceID = SMS_R_System.ResourceId where SMS_G_System_INSTALLED_SOFTWARE.ProductName like “insert your appname here” and SMS_G_System_INSTALLED_SOFTWARE.ProductVersion = “insert your app version here”

Leave a Reply

Your email address will not be published. Required fields are marked *


nine − five =

Post Navigation