DirectoryEntry.DeleteTree Method ()

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Deletes this entry and its entire subtree from the Active Directory Domain Services hierarchy.

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

public void DeleteTree()

Exception Condition
InvalidOperationException

The specified DirectoryEntry is not a container.

Of the Active Directory Service Interfaces (ADSI) system-supplied providers, only the Lightweight Directory Access Protocol (LDAP) currently supports this operation.

System_CAPS_cautionCaution

The entry and its entire subtree are deleted from the Active Directory Domain Services hierarchy.

DirectoryServicesPermission

To delete the entry and its children.

.NET Framework
Available since 1.1
Return to top
Show: