Get all Workstations without an Application (WQL)

Purpose: All Workstations without an Application (WQL)

As an opposite to our previous example we create a device collection, which gathers all workstations that DO NOT HAVE a predefined application. This predefined application must be inserted into the query. The first table shows how to gather workstations WITHOUT an application and not take into account the version number of the application (ignores all versions). The second query ignores only specific versions of the application.


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.

In the first example, we are searching for devices without Mozilla Firefox and in the second example we are searching for devices without Mozilla Firefox and version less than 20.0

 

All Workstations without an Application
Limiting collection: All Systems / All Systems (With Client)
Resource Class: System Resource
SELECT
SYS.ResourceID,
SYS.ResourceType,
SYS.Name,
SYS.SMSUniqueIdentifier,
SYS.ResourceDomainORWorkgroup,
SYS.Client

FROM SMS_R_System AS Sys
WHERE Sys.ResourceID NOT IN (
SELECT ResourceID
FROM SMS_G_System_INSTALLED_SOFTWARE AS SIS
WHERE SIS.ProductName LIKE “Mozilla Firefox%” )

All Workstations without an Application and Version
Limiting collection: All Systems / All Systems (With Client)
Resource Class: System Resource
SELECT
SYS.ResourceID,
SYS.ResourceType,
SYS.Name,
SYS.SMSUniqueIdentifier,
SYS.ResourceDomainORWorkgroup,
SYS.Client

FROM SMS_R_System AS Sys
WHERE Sys.ResourceID NOT IN (
SELECT ResourceID
FROM SMS_G_System_INSTALLED_SOFTWARE AS SIS
WHERE SIS.ProductName LIKE “Mozilla Firefox%” OR SIS.ProductVersion < "20.0" )

Leave a Reply

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


three + six =

Post Navigation