ActiveDirectoryMembershipProvider.GetUser Method (Object, Boolean)


Gets the membership user information associated with the specified user key.

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

	Unrestricted = true)]
	Unrestricted = true)]
	Unrestricted = true)]
public override MembershipUser GetUser(
	object providerUserKey,
	bool userIsOnline


Type: System.Object

The unique identifier for the user.

Type: System.Boolean

The GetUser method ignores this parameter.

Return Value

Type: System.Web.Security.MembershipUser

A MembershipUser instance representing the user specified. If no user is found in the Active Directory data store for the specified providerUserKey value, null is returned.

Exception Condition

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


providerUserKey is not of type SecurityIdentifier.


providerUserKey is null.

The GetUser method is called by the Membership class to retrieve information on the specified user from the Active Directory data store.

The search looks for a user instance where the objectSID attribute matches the providerUserKey parameter.

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.

.NET Framework
Available since 2.0
Return to top