The GetNumResults Windows Management Instrumentation (WMI) class method gets a count of all members in a collection, not including subcollections.
The following syntax is simplified from Managed Object Format (MOF) code and is intended to show the definition of the method.
SInt32 GetNumResults( ref:SMS_Collection Collection, UInt32 Result );
- Data type: ref:SMS_CollectionQualifiers: [in]Collection ID or object path of the collection. The collection ID is the value of the CollectionID property of SMS_Collection Server WMI Class.
- Data type: UInt32Qualifiers: [out]Number of collection members.
An SInt32 data type that is 0 to indicate success or non-zero to indicate failure.
For information about handling returned errors, see About Configuration Manager Errors.
The following example shows how to call the GetNumResults method to get the number of collection members. Specify either a CollectionID value or the full path, such as "SMS_Collection.CollectionID=""SMS00003""".
Dim clsCollection As SWbemObject 'SMS_Collection class definition Dim Results As Long ' Number of collection members Set clsCollection = Services.Get("SMS_Collection") clsCollection.GetNumResults "<collectionid>", Results
For more information, see Configuration Manager Server Runtime Requirements.
For more information, see Configuration Manager Server Development Requirements.
ReferenceSMS_Collection Server WMI Class
Send comments about this topic to Microsoft.