ActiveDirectoryMembershipProvider.UpdateUser(MembershipUser) Method

Definition

Updates information about a user in the Active Directory data store.

C#
public override void UpdateUser(System.Web.Security.MembershipUser user);

Parameters

user
MembershipUser

A MembershipUser instance representing the user to update and the updated information for the user.

Exceptions

The UpdateUser(MembershipUser) method is called before the ActiveDirectoryMembershipProvider instance is initialized.

user is null.

-or-

The RequiresUniqueEmail property is true but the email address from the supplied MembershipUser instance is null.

The Email property is empty after trimming.

-or-

The Email property exceeds 256 characters.

-or-

The Comment property exceeds 1024 characters.

-or-

The Comment property is empty.

-or-

The user name from the supplied MembershipUser instance is empty, or exceeds the maximum length allowed for user names (usually 256 characters).

-or-

The user name from the supplied MembershipUser instance contains commas.

-or-

The user name is mapped to userPrincipalName but the user name from the supplied MembershipUser instance contains backslashes.

The specified user is not found in the Active Directory data store.

-or-

The RequiresUniqueEmail property is true, and the new value of the Email property duplicates an existing email address.

Remarks

This method is called by the Membership class to update user information in the Active Directory data store. The Email, Comment, and IsApproved property values are updated for the specified membership user. All other properties are ignored.

The maximum length for the username parameter is 256 characters. The maximum length for the Email property is 256 characters.

The password for a membership user cannot be updated using the UpdateUser method. To update the password for a membership user, use the ChangePassword method.

The provider uses a subtree search starting at the search point specified in the connection string. See the ActiveDirectoryMembershipProvider class topic for more information about connection strings.

Applies to

Tuote Versiot
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

See also