Jump to content


Damien

OU Based App Deployment

Recommended Posts

Hi All,

 

Can someone please help me with this the queries for these 2 collections?

 

Assume, AD OU is "Software Install"

Create a collection A who's membership rule is based on All computers in the OU, “Software Install""

 

Create a collection B who's membership rule is based on "All computers not in the OU "Software Install", but have software installed"

 

Then, when computer join OU "Software Install", the software will be installed. And when the computer is removed from the OU "Software Install" it's status is "Not in the OU "Software Install", but have the software installed", thus this computer will be added to collection B and receive the software uninstall package to uninstall the software.

Share this post


Link to post
Share on other sites

Depending on the version of SCCM you are using can vary your query assuming you’re on the new and shiny 2012

So Collection A is fairly simple, something along the lines of:

  • 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.SystemOUName = "Domain.local/Software Install"

Collection B would EXCLUDE Collection A and have a query for if the software was installed:

  • select * from SMS_R_System where SMS_R_System.ResourceId not in (select SMS_G_System_ADD_REMOVE_PROGRAMS.ResourceID from SMS_G_System_ADD_REMOVE_PROGRAMS where SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName = "Your Software Here")

 

Now if you are still on 2007 your Collection A would still be the same but your Collections B would be something along the lines of:

  • select * from SMS_R_System where SMS_R_System.ResourceId not in (select SMS_G_System_ADD_REMOVE_PROGRAMS.ResourceID from SMS_G_System_ADD_REMOVE_PROGRAMS where SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName = "Your Software Here") and SMS_R_System.SystemOUName != "Domain.local/Software Install"

adding that it must also not be a member of your OU.

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.