Compartilhar via


VerfiyNoLoops Method in Class SMS_Collection

Applies To: System Center Configuration Manager 2007, System Center Configuration Manager 2007 R2, System Center Configuration Manager 2007 R3, System Center Configuration Manager 2007 SP1, System Center Configuration Manager 2007 SP2

The VerifyNoLoops Windows Management Instrumentation (WMI) class method, in Configuration Manager, verifies that no loops are formed if one collection is the parent of another.

The following syntax is simplified from Managed Object Format (MOF) code and is intended to show the definition of the method.

SInt32 VerifyNoLoops(
      ref:SMS_Collection parentCollection,
      ref:SMS_Collection subCollection,
      Boolean Result
);

Parameters

  • parentCollection
    Data type: ref:SMS_Collection

    Qualifiers: [in]

    Object path to the parent collection.

  • subCollection
    Data type: ref:SMS_Collection

    Qualifiers: [in]

    Object path to the child collection.

  • Result
    Data type: Boolean

    Qualifiers: [out]

    true if the supplied parent-child relationship does not create a loop condition. If this parameter is set to false, the child collection should not be part of the parent collection.

Return Values

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.

Remarks

The application should use this method before creating a parent-child relationship in SMS_CollectToSubCollect Server WMI Class or SMS_CollectToSubCollect_a Server WMI Class.

Example Code

The following example shows how to use the VerifyNoLoops method.

    Dim clsCollection As SWbemObject        ' SMS_Collection class definition.
    Dim Result As Boolean                   ' Loop condition?

    Set clsCollection = Services.Get("SMS_Collection")
    clsCollection.VerifyNoLoops "SMS_Collection.CollectionID=""<collectionid>""", _
                                "SMS_Collection.CollectionID=""<collectionid>""", _
                                Result

Requirements

Runtime Requirements

For more information, see Configuration Manager Server Runtime Requirements.

Development Requirements

For more information, see Configuration Manager Server Development Requirements.

See Also

Reference

SMS_Collection Server WMI Class