Hi All,

short blog post to highlight the evolution that happens between the WMI properties of ConfigMgr 2012 and SCCM 2007.

Over the years, I have develpped quite a big amount of PowerShell functions based on WMI to automate the Administration of ConfigMgr. Orignally, the module was written for SCCM 2007. ConfigMgr 2012 is Based on the same Base (WMI and SQL views) as ConfigMgr 2007. This means that the module written in WMI for 2007 works alsmot justwithout any effort for a ConfigMgr 2012 Version. The exception is the new Features that have been added, the Features that have been removed, and in some rare cases, the views or WMI classes that have been renamed.

I have been working on a very interesting Project recently where I Need to make a sync from a full ConfigMGr 2012 infrastructure to another one. I was trying to create a new collection rule using the that ConfigMgr module  to automate things in SCCM 2012, and then  I had the following error:

Add-SCCMCollectionRule : Exception setting “LimitToCollectionID”: “The property ‘LimitToCollectionID’ cannot be found on this object. Verify that the property exists and can be set.”
At line:10 char:13
+ Add-SCCMCollectionRule -SccmServer $sccm -collectionID $collectionID …
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Add-SCCMCollectionRule], SetValueInvocationException
+ FullyQualifiedErrorId : ExceptionWhenSetting,Add-SCCMCollectionRule

I googled the WMI SMS_CollecitonRuleQuery class and looked at the properties on MSDN. At first glance everything looked ok. (as showned below).

Updated: October 28, 2009

Class SMS_CollectionRuleQuery : SMS_CollectionRule
{
String LimitToCollectionID;
String QueryExpression;
UInt32 QueryID;
String RuleName;
};

Full page available here

After a second closer look, and a look directly in WMI,

We can see that the SMS_CollectionRuleQuery class has been updated, and that the LimitToCollectionID is not existing anymore.

 

Full Page available here

Updated: November 1, 2013

Class SMS_CollectionRuleQuery : SMS_CollectionRule
{
String QueryExpression;
UInt32 QueryID;
String RuleName;
};

Full page available here

 

The main point I wanted to highlight with this post is that when you look for documentation online, be sure to take a look at the date. You have different versions of same documentation online, and It could be missleading.