This documentation is archived and is not being maintained.

DirectoryEntry.Parent Property

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

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

public DirectoryEntry Parent { get; }
/** @property */
public DirectoryEntry get_Parent ()

public function get Parent () : DirectoryEntry

Not applicable.

Property Value

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);

Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0