- username
The name of the user to delete.
- deleteAllRelatedData
This parameter is ignored by the ActiveDirectoryMembershipProvider.DeleteUser(string, bool) method.
![]()
true if the user was deleted; otherwise, false if the user was not found in the data store.
The ActiveDirectoryMembershipProvider.DeleteUser(string, bool) method immediately removes the user identified by the username parameter. Since the Active Directory data store does not store user information in separate areas of the directory, the deleteAllRelatedData parameter is ignored, although it must be set to either true or false when calling the ActiveDirectoryMembershipProvider.DeleteUser(string, bool) method.
The System.Web.Security.ActiveDirectoryMembershipProvider class finds the user instance to delete by performing a single-level search for the user name in the users container determined by the connection string. See the System.Web.Security.ActiveDirectoryMembershipProvider class topic for more information about connection strings.
username must be 64 characters or less.
You cannot delete users unless the credentials used to connect to the Active Directory server have either Domain Administrator rights (not recommended) or the "delete child instances" access right.