Share via


IMAExtensible2GetHierarchy.GetHierarchy Method

Provides a method for returning the hierarchy of objects in a connected system.

Namespace: Microsoft.MetadirectoryServices
Assembly: Microsoft.MetadirectoryServicesEx (in Microsoft.MetadirectoryServicesEx.dll)

Usage

'Usage
Dim instance As IMAExtensible2GetHierarchy
Dim configParameters As KeyedCollection(Of String, ConfigParameter)
Dim parent As HierarchyNode
Dim returnValue As IList(Of HierarchyNode)

returnValue = instance.GetHierarchy(configParameters, parent)

Syntax

'Declaration
Function GetHierarchy ( _
    configParameters As KeyedCollection(Of String, ConfigParameter), _
    parent As HierarchyNode _
) As IList(Of HierarchyNode)
IList<HierarchyNode> GetHierarchy (
    KeyedCollection<string,ConfigParameter> configParameters,
    HierarchyNode parent
)
IList<HierarchyNode^>^ GetHierarchy (
    KeyedCollection<String^, ConfigParameter^>^ configParameters, 
    HierarchyNode^ parent
)
IList<HierarchyNode> GetHierarchy (
    KeyedCollection<String,ConfigParameter> configParameters, 
    HierarchyNode parent
)
function GetHierarchy (
    configParameters : KeyedCollection<String,ConfigParameter>, 
    parent : HierarchyNode
) : IList<HierarchyNode>

Parameters

Return Value

Returns the list of child HierarchyNode belonging to the input HierarchyNode object.

Remarks

The GetHierarchy method is used when the DistinguishedNameStyle is LDAP. It allows an administrator to browse the structure in the directory and select in and out-of-scope containers for import and export.

This method is called during interaction with the administrator when a node is expanded. The method is provided the parent node for which the administrator selected to expand. The result should be a list of direct children to the parent node. Only objects which can contain other objects should be returned.

The list of selected and unselected containers in the hierarchy is stored by the engine and is used to determine which objects should be filtered out during import and export.

Exceptions: Return values, Errors, and Exceptions

The following is an example of GetHierarchy:

public IList<HierarchyNode> GetHierarchy(KeyedCollection<string, ConfigParameter> configParameters, HierarchyNode parent)
        {
            IList<HierarchyNode> children = new List<HierarchyNode>();
 
            if ("DC=contoso,DC=com" == parent.DN)
            {
                children.Add(HierarchyNode.Create("CN=Computers,DC=contoso,DC=com", "Computers"));
                children.Add(HierarchyNode.Create("OU=Groups,DC=contoso,DC=com", "Groups"));
                children.Add(HierarchyNode.Create("OU=TestUsers,DC=contoso,DC=com", "TestUsers"));
                children.Add(HierarchyNode.Create("CN=Users,DC=contoso,DC=com", "Users"));
            }
 
            return children;
        }

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Target Platforms

Change History

See Also

Reference

IMAExtensible2GetHierarchy Interface
IMAExtensible2GetHierarchy Members
Microsoft.MetadirectoryServices Namespace