The SMS_Collection Windows Management Instrumentation (WMI) class is an SMS Provider server class, in System Center 2012 Configuration Manager, that represents a collection of resources related logically by rules, along with collection information.

The following syntax is simplified from Managed Object Format (MOF) code and includes all inherited properties.

Class SMS_Collection : SMS_BaseClass 
{ 
   String CollectionID; 
   SMS_CollectionRule CollectionRules[]; 
   UInt32 CollectionType; 
   SInt32 CollectionVariablesCount; 
   String Comment; 
   UInt32 CurrentStatus;
   Boolean HasProvisionedMember; 
   SInt32 IncludeExcludeCollectionsCount; 
   Boolean IsBuiltIn; 
   Boolean IsReferenceCollection;
   UInt8 ISVData[]; 
   UInt32 ISVDataSize; 
   DateTime LastChangeTime; 
   DateTime LastMemberChangeTime; 
   DateTime LastRefreshTime; 
   String LimitToCollectionID; 
   String LimitToCollectionName; 
   SInt32 LocalMemberCount; 
   String MemberClassName; 
   SInt32 MemberCount; 
   UInt32 MonitoringFlags; 
   String Name; 
   Boolean OwnedByThisSite; 
   SInt32 PowerConfigsCount; 
   SMS_ScheduleToken RefreshSchedule[]; 
   UInt32 RefreshType; 
   Boolean ReplicateToSubSites; 
   SInt32 ServiceWindowsCount; 
};

Methods

The following table lists the methods in the SMS_Collection class.

Method Description

AddMembershipRule Method in Class SMS_Collection

Adds one new rule to the CollectionRules property of SMS_Collection.

AddMembershipRules Method in Class SMS_Collection

Adds multiple new rules to the CollectionRules property of SMS_Collection.

AMTOperateForCollection Method in Class SMS_Collection

Runs an Active Management Technology (neAMT) operation on this collection.

AMTOperateForMachines Method in Class SMS_Collection

Runs an AMT operation on a set of computers.

ApproveClients Method in Class SMS_Collection

Approves specified client computers to join the site.

BlockClients Method in Class SMS_Collection

Blocks specified client computers from communicating with the site.

ClearLastNBSAdvForCollection Method in Class SMS_Collection

Clears the last Network Boot advertisement for a selected collection.

ClearLastNBSAdvForMachines Method in Class SMS_Collection

Clears the last Network Boot advertisement for selected client computers.

CreateCCR Method in Class SMS_Collection

Creates a client configuration request (CCR) for a particular resource.

CreateCCRs Method in Class SMS_Collection

Generates client configuration requests (CCRs) for the computers in the collection.

DeleteAllMembers Method in Class SMS_Collection

Deletes all members, that is, resources and discovery data, for the collection.

DeleteMembershipRule Method in Class SMS_Collection

Deletes a membership rule from the collection.

DeleteMembershipRules Method in Class SMS_Collection

Deletes multiple membership rules from the collection.

FindResourceSite Method in Class SMS_Collection

Gets site code information for a computer from SQL.

FindMachineSite Method in Class SMS_Collection

Gets site code information for resources from SQL.

GetNumResults Method in Class SMS_Collection

Gets a count of all members in a collection, excluding subcollections.

GenerateCCRByName Method in Class SMS_Collecton

Generates a client configuration request by computer name.

GetTotalNumResults Method in Class SMS_Collection

Gets a count of all members in a collection, including subcollections.

RequestRefresh Method in Class SMS_Collection

Triggers a re-evaluation of collection membership by the System Center 2012 Configuration Manager collection evaluator component.

UpdateVisibilityInEPDashBoard in Class SMS_Collection

Show this collection in the EndPoint Protection dashboard.

VerifyNoCircularDependencies Method in Class SMS_Collection

Verifies that no circular dependencies are formed if one collection is the parent of another.

Properties

CollectionID

Data type: StringAccess type: Read-only Qualifiers: [key, read]Unique auto-generated ID containing eight characters. The default value is "".The format of the collection ID is the site code that created the collection followed by a five-digit hexadecimal serial number, for example, "JAX0002C". The default Configuration Manager collections, created during the installation, use the "SMS" prefix, for example, "SMS00001".
CollectionRules

Data type: SMS_CollectionRule ArrayAccess type: Read/WriteQualifiers: [lazy]SMS_CollectionRule Server WMI Class objects defining the membership criteria for the collection.
CollectionType

Data type: UInt32Access type: Read-onlyQualifiers: [read, enumeration]Count of collection variables.

0

OTHER

1

USER

2

DEVICE

CollectionVariablesCount

Data type: SInt32Access type: Read-onlyQualifiers: [read]Count of collection variables.
Comment

Data type: StringAccess type: Read/WriteQualifiers: NoneGeneral comment or note that documents the collection. The default value is "".
CurrentStatus

Data type: UInt32Access type: Read-onlyQualifiers: [read, enumeration]Current status of the collection. Possible values are:

0

NONE

1

READY

2

REFRESHING

3

SAVING

4

EVALUATING

5

AWAITING_REFRESH

6

DELETING

7

APPENDING_MEMBER

8

QUERYING

HasProvisionedMember

Data type: BooleanAccess type: Read-onlyQualifiers: [read]true if this collection has provisioned members. This information applies only to System Center Configuration Manager SP1.
IncludeExcludeCollectionsCount

Data type: SInt32Access type: Read-onlyQualifiers: [read]Count of collections that are included and excluded with this one.
IsBuiltIn

Data type: BooleanAccess type: Read-OnlyQualifiers: [read]This value, when set to true, denotes that the collection is built in.
IsReferenceCollection

Data type: BooleanAccess type: Read-onlyQualifiers: [read]This value, when set to true, denotes that the collection is not limited by another collection.
ISVData

Data type: UInt8[]Access type: Read/WriteQualifiers: [large, lazy]A data space for Partner extensibility.
ISVDataSize

Data type: UInt32Access type: Read/WriteQualifiers: [lazy]The ISVData size.
LastChangeTime

Data type: DateTimeAccess type: Read/WriteQualifiers: NoneDate and time of when the collection was last altered in any way.
LastMemberChangeTime

Data type: DateTimeAccess type: Read/WriteQualifiers: NoneDate and time of when the collection membership was last altered.
LastRefreshTime

Data type: DateTimeAccess type: Read/WriteQualifiers: NoneDate and time of when the collection membership was last refreshed.
LimitToCollectionID

Data type: StringAccess type: Read/WriteQualifiers: NoneThe CollectionID of the collection to limit the query results to.
LimitToCollectionName

Data type: DateTimeAccess type: Read/WriteQualifiers: NoneThe Name of the collection to limit the query results to.
LocalMemberCount

Data type: SInt32Access type: Read-onlyQualifiers: [read]Count of members visible at the local site.
MemberClassName

Data type: StringAccess type: Read-onlyQualifiers: [read]Class name having instances that are the members of the collection. The collection membership is not contained in SMS_Collection but is instead contained in the class name specified by this property. The class name is generated dynamically and is derived from SMS_CM_RES_COLL_CollectionID Server WMI Class.
MemberCount

Data type: SInt32Access type: Read-onlyQualifiers: [read]A count of the collection members.
MonitoringFlags

Data type: UInt32Access type: Read-onlyQualifiers: [read]Enables the collection for certain kinds of monitoring.
Name

Data type: StringAccess type: Read/WriteQualifiers: [Not_null]The name of the collection. This value represents the collection in the System Center 2012 Configuration Manager console and should be unique. The default value is "New Collection".
OwnedByThisSite

Data type: BooleanAccess type: Read/WriteQualifier: Nonetrue if the collection originated at the local Configuration Manager site. The default value is false.
PowerConfigsCount

Data type: SInt32Access type: Read-onlyQualifier: [read]A count of the power configurations.
RefreshSchedule

Data type: SMS_ScheduleToken Array Access type: Read/WriteQualifiers: [max(15), lazy]SMS_ScheduleToken Server WMI Class objects indicating an update or refresh schedule for the collection. The collection membership is only updated if your application specifies a schedule or calls the RequestRefresh Method in Class SMS_Collection method. For the collection evaluator to use the schedule, the RefreshType property must be set to PERIODIC.
RefreshType

Data type: UInt32Access type: Read/Write Qualifiers: [lazy, enumeration]Refresh type indicating how Configuration Manager refreshes the collection. Possible values are listed below. The default value is MANUAL (1).

1

MANUAL

2

PERIODIC

4

CONSTANT_UPDATE

Set this property to PERIODIC to base the refresh on the schedule specified in RefreshSchedule. A setting of MANUAL manually updates the collection by using the RequestRefresh Method in Class SMS_Collection.
ReplicateToSubSites

This property is not implemented.
ServiceWindowsCount

Data type: SInt32Access type: Read-onlyQualifiers: [read]Count of maintenance windows.

Remarks

Class qualifiers for this class include:

  • Secured

For more information about both the class qualifiers and the property qualifiers included in the Properties section, see Configuration Manager Class and Property Qualifiers.

Collection information represented by this class includes the refresh schedule and the members, represented by SMS_CM_RES_COLL_CollectionID Server WMI Class objects. Your application can use a collection to target resources for software distribution.

When you run a query against a dynamic collection represented by SMS_Collection, ensure that the SMS Provider is loaded or that another method or query has already run.

The application should use the SMS_Collection methods to add, update, or delete membership rules defined by the CollectionRules property. This property is not retrieved when your application enumerates SMS_Collection. To obtain the collection rules for a collection, your application must use IWbemServices::GetObject or SWbemServices::Get. For more information, see Configuration Manager Context Qualifiers.

For information about using the SMS_Collection class and its methods, see Configuration Manager Collections.

Requirements

Runtime Requirements

Development Requirements

See Also