Powershell: Script for configuring collection update refresh settings in Configuration Manager 2012

 

Sometimes you might want to configure how collections update in Configuration Manager 2012. Accomplishing this for a few collections works fine using the GUI, but if you want to change collection update settings for hundreds, or thousands of collections at the same time, this won’t be an option.

 

Configuration Manager SCCM 2012 Collection Updates

 

If you need to do this, use this script 🙂 It reads the collections IDs from a file called “collections.txt” that needs to be in the same folder as the script and then sets the necesserary options.

Collection options, i.e Incremental Updates, Scheduled Updates, are set using the collection property “refreshtype”. Depedning on what integer is set here, different options will be set. These are the available options:

6 = Incremental and Scheduled Updates
4 = Incremental Updates Only
2 = Scheduled Updates only
1 = Manual Update only

The script needs to be run with one of these set and also the type of collections that are defined in collections.txt. Valid options here are User or Device.

If you would want to configure device collections in collections.txt to only update on a schedule, you would run this command:

Note that if you tick the “Schedule a full update on this collection” it will set the value that is set to the collection object. If you have changed that value sometime in the past, it will use that value or if you have never changed it, it will use the default value “Occurs every 2 weeks on Thursday effective 2/1/1970 12:00 AM”.

Here is the output of the sciprt.

Powershell script to set Configuration Manager SCCM 2012 collection update

 

Download the script from the TechNet Library.
Source code:

Leave a Reply