-3

I have an install collection that devices get added to manually. Is there a way from within SCCM to remove those devices from the collection automatically after it detects the software has been installed for more than a certain number of days? I know I can do it through PowerShell outside of SCCM. I just want to know if it's something I can keep within SCCM for easier tracking.

King Nada
  • 1
  • 2
  • Please see ["Should questions include “tags” in their titles?"](http://meta.stackexchange.com/questions/19190/should-questions-include-tags-in-their-titles), where the consensus is "no, they should not"! –  Dec 11 '15 at 15:18

1 Answers1

0

You could do this with two collections, with one of them being a query based collection.

Your flow would become:

  • User needs software
  • Put user or PC in collection
  • Advert runs on their system
  • Software is detected, user dynamically added to Users with FireFox
  • Weekly, the Deploy Firefox collection will update, excluding members of the above collection, kicking them out of the Deploy Collection

The thing would be that you'd need one such collection per application, because if you had too many apps targeted at the collection, you'd only need the user to have one in order to be removed from the collection.

To do this, I'd make two collections:

  • Deploy FireFox
  • Users with FireFox

For Users with FireFox, here's the WQL for that sort of 'has an application' based query:

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.Name 
not in 
    (select SMS_R_System.Name 
    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.DisplayName 
    like "Firefox")
order by SMS_R_System.Name

Next, make an EXCLUDE rule for your Deploy FireFox collection, set it to exclude all users who are in the Users with FireFox Collection.

To achieve your goal of removing people after X days, just set your collection update frequency to only update every so often, like this (assuming you want to remove people from the Deploy group roughly a week after getting software):

  • Deploy FireFox - Update Collection Membership - weekly, Incremental Update - Disabled
  • Users with FireFox - update collection membership - daily, Incremental Update - Enable

Makes sense?

FoxDeploy
  • 12,569
  • 2
  • 33
  • 48