ActiveDirectoryMembershipProvider.UpdateUser Method

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

Namespace: System.Web.Security
Assembly: System.Web (in system.web.dll)

'Declaration
Public Overrides Sub UpdateUser ( _
	user As MembershipUser _
)
'Usage
Dim instance As ActiveDirectoryMembershipProvider
Dim user As MembershipUser

instance.UpdateUser(user)
public void UpdateUser (
	MembershipUser user
)
public override function UpdateUser (
	user : MembershipUser
)
Not applicable.

Parameters

user

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

Exception typeCondition

InvalidOperationException

The UpdateUser method is called before the ActiveDirectoryMembershipProvider instance is initialized.

ArgumentNullException

user is a null reference (Nothing in Visual Basic).

- or -

The RequiresUniqueEmail property is true but the email address from the supplied MembershipUser instance is a null reference (Nothing in Visual Basic).

ArgumentException

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.

ProviderException

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 e-mail address.

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.

Windows 98, Windows Server 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0

Community Additions

ADD
Show: