This documentation is archived and is not being maintained.

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)

[DirectoryServicesPermissionAttribute(SecurityAction.Assert, Unrestricted = true)]
[AspNetHostingPermissionAttribute(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[DirectoryServicesPermissionAttribute(SecurityAction.InheritanceDemand, Unrestricted = true)]
[DirectoryServicesPermissionAttribute(SecurityAction.Demand, Unrestricted = true)]
[AspNetHostingPermissionAttribute(SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public override MembershipUser GetUser(
	Object providerUserKey,
	bool userIsOnline
)

Parameters

providerUserKey
Type: System.Object

The unique identifier for the user.

userIsOnline
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.

ExceptionCondition
InvalidOperationException

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

ArgumentException

providerUserKey is not of type SecurityIdentifier.

ArgumentNullException

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.

Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0, 2.0
Show: