Skip to content

Collection uninstall

Featured Replies

Hello,

I use AD-groups when deploying applications and I want to create an automatic uninstall when the computer object is not included in the AD group (removed from the group).
I created a collection and query that checks if the application is installed but the computer object is not included in the group.

This is what I got so far:

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_ADD_REMOVE_PROGRAMS on SMS_G_System_ADD_REMOVE_PROGRAMS.ResourceID = SMS_R_System.ResourceId where SMS_G_System_ADD_REMOVE_PROGRAMS.ProdID like "{34624CAC-1434-468E-56DC-2A7D44D5F49F}" and SMS_R_System.SecurityGroupName != "MGT\\App-install-Adapt"
 

It does not work properly - some computers are listed even though they are in the install AD-group.

 

Thanks in advance
 

6 hours ago, kaiserclaw said:

This is what I got so far:

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_ADD_REMOVE_PROGRAMS on SMS_G_System_ADD_REMOVE_PROGRAMS.ResourceID = SMS_R_System.ResourceId where SMS_G_System_ADD_REMOVE_PROGRAMS.ProdID like "{34624CAC-1434-468E-56DC-2A7D44D5F49F}" and SMS_R_System.SecurityGroupName != "MGT\\App-install-Adapt"
 

 

You will need to use a sub-select query to do the not in stuff. 

Here is an example. https://www.enhansoft.com/blog/subselect-wql-query-to-find-pcs-that-do-not-have-either-x86-or-x64-versions-of-software-installed

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.