Parent Property

DirectoryEntry.Parent Property

 

Gets this entry's parent in the Active Directory Domain Services hierarchy.

Namespace:   System.DirectoryServices
Assembly:  System.DirectoryServices (in System.DirectoryServices.dll)

[BrowsableAttribute(false)]
[DSDescriptionAttribute("DSParent")]
public DirectoryEntry Parent { get; }

Property Value

Type: System.DirectoryServices.DirectoryEntry

A DirectoryEntry object that represents the parent of this entry.

The following example searches a given DirectoryEntry and displays the Name and Parent of the result.

String myADSPath = "LDAP://onecity/CN=user,CN=Users,DC=onecity,DC=corp,DC=fabrikam,DC=com";
DirectoryEntry myDirectoryEntry=new DirectoryEntry(myADSPath, UserName, SecurelyStoredPassword);

Console.WriteLine("Parent is :"+myDirectoryEntry.Parent.Path);

.NET Framework
Available since 1.1
Return to top
Show:
© 2016 Microsoft