How to: Enable Incremental Collection Updates With PowerShell
February 15, 2012 8 Comments
ConfigMgr 2007 R3 shipped with a feature called Incremental Updates for collections, and ConfigMgr 2012 also supports this feature. From the official docs, here’s what incremental updates do for you:
Select this option to periodically scan for only new or changed resources from the previous collection evaluation and update the collection membership with only these resources, independently of a full collection evaluation. By default, incremental updates occur at 10 minute intervals.
This post will demonstrate how to identify collections with incremental updates enabled, as well as how to enable incremental updates for a collection.
Here’s an example to list all collections that have incremental updates enabled:
#display collections with incremental updates enabled #replace mycfgmgrlab with site server name, LAB with Site code gwmi sms_collection -computer mycfgmgrlab ` -namespace root\sms\site_LAB | foreach { $Coll = [wmi] $_.__Path if ($Coll.RefreshType -eq 6) { write-host $Coll.CollectionID "`t" $Coll.Name } }
Since RefreshType is a lazy property, you must take some extra steps. use get-wmiobject (alias is gwmi) to get all collections, then perform a for-each loop to use query the instance directly using the [wmi] accelerator for PowerShell. Finally, check to see if RefreshType = 6.
Here’s an example to enable incremental updates on a collection:
#enable incremental updates on a collection #replace mycfgmgrlab with site server name, LAB with Site code, #and LAB007DE with desired collecitonid $a = [wmi] "\\mycfgmgrlab\root\sms\site_LAB:SMS_Collection.CollectionID='LAB007DE'" $a.RefreshType = 6 $a.put()
Use the [WMI] accelerator to grab the specific instance with lazy properties, and set RefreshType = 6
Valid values for RefreshType:
- 6 = Incremental and Periodic Updates
- 4 = Incremental Updates Only
- 2 = Periodic Updates only
- 1 = Manual Update only
For more information about Incremental Updates, review’ the Microsoft page for Creating Collections in ConfigMgr 2012 (expand the node “To Create a Device Collection” to see the details.) Also note that the following classes do not support incremental updates:
- SMS_G_System_CollectedFile
- SMS_G_System_LastSoftwareScan
- SMS_G_System_AppClientState
- SMS_G_System_DCMDeploymentState
- SMS_G_System_DCMDeploymentErrorAssetDetails
- SMS_G_System_DCMDeploymentCompliantAssetDetails
- SMS_G_System_DCMDeploymentNonCompliantAssetDetails
- SMS_G_User_DCMDeploymentCompliantAssetDetails (for collections of users only)
- SMS_G_User_DCMDeploymentNonCompliantAssetDetails (for collections of users only)
- SMS_G_System_SoftwareUsageData
- SMS_G_System_CI_ComplianceState
- SMS_G_System_EndpointProtectionStatus
- SMS_GH_System_*
- SMS_GEH_System_*
More information about Lazy Properties:
- Microsoft ConfigMgr 2007 Docs
- Trevor Sullivan’s blog also has a great post on Lazy Properties.
- The SMS_Collection WMI Class
Greg
[edit 6/18/2012 to add 4=Incremental Updates Only – Thanks Josef!]
Hi Greg, there is an additional value for RefreshType.
4 = Incremental updates only
Regards, Josef
Thanks for the info! I was able to update over 140 collections with a new collection RefreshType using your suggestion.
Great! Glad it helped!
Thank you for this post! I discovered that we had 2500+ collections with Incremental Updates on. This was eye opening!
I used Brandon Linton’s script (http://blogs.technet.com/b/brandonlinton/archive/2013/04/23/powershell-how-to-disable-incremental-collection-updates-in-mass.aspx) with yours to reset all of our collections back to Periodic Updates with some exceptions. I then set it up as a scheduled task.
Thanks again and Go Blue!!!!
Great news! (except for the Go Blue part :))
Pingback: fabiotreze ConfigMgr Blog
Pingback: Um pouco sobre o Incremental Update de Collections no System Center 2012 R2 Configuration Manager - fabiotreze ConfigMgr Blog - Site Home - TechNet Blogs
Older post, I know… but I just had to use this (from the TechNet tweaked script) to disable incremental updates on a slew of collections setup with incremental eval–when they shouldn’t have been. Extremely helpful, Thanks Greg!