DirectoryEntry.DeleteTree ()
The DeleteTree method deletes this entry and its entire subtree from the Active Directory hierarchy.
public void DeleteTree();
Public Sub DeleteTree()
Parameters
This method has no parameters.
Return Values
This method has no return values.
Exceptions
Exception type | Condition |
---|---|
InvalidOperationException | The specified DirectoryEntry is not a container. |
Security
- Use DirectoryServicesPermission for deleting from the Active Directory hierarchy. Associated enumeration: DirectoryServicesPermissionAccess.Write.
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries From Partially Trusted Code.
Remarks
Of the Active Directory Service Interfaces (ADSI) system-supplied providers, only the Lightweight Directory Access Protocol (LDAP) currently supports this operation.
Caution The entry and its entire subtree are deleted from the Active Directory hierarchy.
Requirements
Client | Requires Windows XP Home Edition, Windows XP Professional, Windows Me, or Windows 98. |
Server | Requires Windows Server 2003, Windows 2000, or Windows NT 4.0. |
Namespace | Defined in System.DirectoryServices. |
Assembly | Requires System.DirectoryServices (in System.DirectoryServices.dll). |
.NET Framework | Requires .NET Framework 1.0. |
See Also
DirectoryEntry Class, DirectoryEntry Methods, DirectoryEntry Members (Visual J# Syntax), Managed Extensions for C++ Programming, System.DirectoryServices Namespace