ActiveDirectoryMembershipProvider.GetUser Method (String, Boolean)
Gets the membership user information associated with the specified user name.
Assembly: System.Web (in System.Web.dll)
Parameters
- username
- Type: System.String
The name of the user to get information for.
- userIsOnline
- Type: System.Boolean
The GetUser method ignores this parameter.
Return Value
Type: System.Web.Security.MembershipUserA MembershipUser instance representing the user specified. If no user is found in the Active Directory data store for the specified username value, a null reference (Nothing in Visual Basic) is returned.
| Exception | Condition |
|---|---|
| ArgumentException | username is empty, or exceeds the maximum length for the user name (usually 256 characters). - or - username contains commas. - or - The user name is mapped to the userPrincipalName attribute and the username parameter contains backslashes. |
| ArgumentNullException | username is a null reference (Nothing in Visual Basic). |
| InvalidOperationException | The GetUser method is called before the ActiveDirectoryMembershipProvider instance is initialized. |
The GetUser method is called by the Membership class to retrieve information on the specified user from the Active Directory data store.
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.
Leading and trailing spaces are trimmed from the username parameter value.
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.