Tuesday, March 20, 2012

ConfigMgr 2007: Deploy and remove software by AD group

In ConfigMgr 2007 there are many ways to deploy software.  One that has been brought up to me several times is how can we deploy software based on AD group.  Below is the steps to do so.  You will advertise your installer to the Needs Collection and your Removal to the Remove Collection.  These collections will automatically move the group members to the correct collection based on installed status.  **Be careful to ensure all members are in the AD group that you intend to keep the software installed on as if you have software already deployed via manual install or other means it will fall into the remove collection unless the group is updated.

  1. Create a new AD group that you wish to use to deploy software to.
  2. Create 4 new Collections within the ConfigMgr Console
    1. Create the application collection <Application Name>  ie. Microsoft Lync
    2. Create 3 Sub Collections
      1. Create a Has <Application Name>
      2. Create a Need <Application Name>
      3. Create a Remove <Application Name>
  3. Create your membership rules for each collection.  These will all be query based collections
    1. For the Has <Application Name> collection use the following query.  ***Be sure to update the areas in <> in the query
      1. 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_R_System.SystemGroupName = “<DomainName>\\<AD Group>" and SMS_G_System_INSTALLED_SOFTWARE.ARPDisplayName
        like "<AddRemoveProgramsDisplayName>"
    2. For the Need <Application Name> collection use the following query.  ***Be sure to update the areas in <> in the query
      1. 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_SYSTEM on SMS_G_System_SYSTEM.ResourceID = SMS_R_System.ResourceId
        where SMS_R_System.SystemGroupName = "<DomainName>\\<AD Group>" and SMS_G_System_SYSTEM.Name not in
            (select SMS_R_System.Name 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.ARPDisplayName like
            "<AddRemoveProgramsDisplayName>")
    3. For the Remove <Application Name> collection use the following query.  ***Be sure to update the areas in <> in the query
      1. 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
            inner join SMS_G_System_SYSTEM on SMS_G_System_SYSTEM.ResourceID = SMS_R_System.ResourceId
        where SMS_G_System_INSTALLED_SOFTWARE.ARPDisplayName like "<AddRemoveProgramsDisplayName>" and SMS_G_System_SYSTEM.Name not in
            (select SMS_R_System.Name from  SMS_R_System where SMS_R_System.SystemGroupName = "<DomainName>\\<AD Group>")

No comments:

Post a Comment