Jump to content


Recommended Posts

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
 

Share this post


Link to post
Share on other sites

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

  • Like 1

Share this post


Link to post
Share on other sites

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...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...


×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.