SMS_Collection
The SMS_Collection WMI class contains the rules that logically relate resources into collections of resources. This class also contains information about the collection, such as the refesh schedule and the class name that contains the members, SMS_CM_RES_COLL_CollectionID. You can use a collection to target resources for software distribution.
The following syntax is simplified from MOF code and includes all inherited properties.
Class SMS_Collection : SMS_BaseClass
{
string CollectionID;
SMS_CollectionRule CollectionRules[];
string Comment;
uint32 CurrentStatus;
datetime LastChangeTime;
datetime LastRefreshTime;
string MemberClassName;
string Name;
Boolean OwnedByThisSite;
SMS_ScheduleToken RefreshSchedule[];
uint32 RefreshType;
boolean ReplicateToSubSites;
};
Properties
CollectionID
Data type: string
Access type: Read-only
Qualifiers: KeyUnique, auto-generated identifier containing eight characters. The format of the identifier is the site code that created the collection followed by a 5 digit hex serial number, such as JAX0002C. The default SMS collections, created during the SMS installation, use the SMS prefix, such as SMS00001.
CollectionRules
Data type: SMS_CollectionRule[]
Access type: Read-only
Qualifiers: LazyDefines the membership criteria for this collection. You use the SMS_Collection methods to add, update, or delete membership rules. The rules are embedded objects of type SMS_CollectionRuleQuery and SMS_CollectionRuleDirect.
This property is not returned when you enumerate this class. To obtain the collection rules for a collection, you must use IWbemServices::GetObject or SWbemServices.Get.
Comment
Data type: string
Access type: Read/writeGeneral comment or note that documents the collection.
CurrentStatus
Data type: uint32
Access type: Read-onlyCurrent status of the collection. Values are:
NONE (0)
READY (1)
REFRESHING (2)
SAVING (3)
EVALUATING (4)
AWAITING_REFRESH (5)
DELETING (6)
APPENDING_MEMBER (7)
QUERYING (8)LastChangeTime
Data type: datetime
Access type: Read/writeDate and time the collection was last altered in any way.
LastRefreshTime
Data type: datetime
Access type: Read/writeDate and time the collection membership was last refreshed.
MemberClassName
Data type: string
Access type: Read-onlyClass name whose instances are the members of this 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 has the format SMS_CM_RES_COLL_CollectionID.
Name
Data type: string
Access type: Read/writeRequired. Name of the collection. This value represents the collection in the console and should be unique.
OwnedByThisSite
Data type: boolean
Access type: Read/write
Qualifiers: LazyIndicates whether the collection originated from the local SMS site. The Lazy qualifier has been removed from this property for version 2.0 SP2 and later.
RefreshSchedule
Data type: SMS_ScheduleToken[]
Access type: Read/write
Qualifiers: Max(15)Defines an update or refresh schedule for the collection. The collection membership is only updated if you specify a schedule or call the RequestRefresh method. For the collection evaluator to use the schedule, the RefreshType property must be set to PERIODIC.
RefreshType
Data type: uint32
Access type: Read/write
Qualifiers: LazyDefines whether SMS periodically refreshes the collection based on the schedule specified in RefreshSchedule, or whether you manually update the collection using the RequestRefresh method. Values are:
MANUAL (1)
PERIODIC (2)ReplicateToSubSites
Data type: boolean
Access type: Read/write
Qualifiers: LazyIndicates whether the collection is shared with any child SMS sites.
Methods
The following table lists the methods in SMS_Collection.
Method | Description |
---|---|
AddMembershipRule | Adds a new rule to the collection. This can also be used to modify a membership rule. |
AddMembershipRules | Adds one or more rules to the collection. This can also be used to modify membership rules. |
DeleteAllMembers | Deletes all members of the collection and their related resources and discovery data. |
DeleteMembershipRule | Deletes a rule from the collection. |
DeleteMembershipRules | Deletes one or more rules from the collection. |
GetNextID | Reserved. |
GetNumResults | Returns the number of immediate members. |
GetTotalNumResults | Returns the number of all members, including subcollections. |
RequestRefresh | Forces a refresh of the collection. |
SetNextID | Reserved. |
VerifyNoLoops | Verifies that no loops would be formed if one collection were the parent of another. |
Remarks
The following actions are initiated by the provider when you delete a collection.
- The collection membership class, referenced in the MemberClassName property, is deleted.
- The collection is removed from the collection hierarchy (SMS_CollectToSubCollect and SMS_CollectToSubCollect_a). This may orphan other collections in the hirearchy. For more information, see Managing a Collection Hierarchy.
- Advertisements that reference the collection are deleted. if you want to retain the advertisement, you will need reference a new collection before deleting the current collection.
For information on using the SMS_Collection class and its methods, see Managing Collections.
See Also
Collection Classes, SMS_CM_RES_COLL_CollectionID, SMS_CollectionRuleDirect, SMS_CollectionRuleQuery, SMS_CollectToSubCollect, SMS_ScheduleToken