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)

public:
[BrowsableAttribute(false)]
[DSDescriptionAttribute("DSParent")]
property DirectoryEntry^ Parent {
	DirectoryEntry^ 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 = gcnew DirectoryEntry(myADSPath, UserName, SecurelyStoredPassword);

Console::WriteLine("Parent is :{0}", myDirectoryEntry->Parent->Path);

.NET Framework
Available since 1.1
Return to top
Show: