UserCollection.GetByLoginName method

Returns the user with the specified login name.

Namespace:  Microsoft.SharePoint.Client
Assembly:  Microsoft.SharePoint.Client (in Microsoft.SharePoint.Client.dll)

Syntax

'Declaration
Public Function GetByLoginName ( _
    loginName As String _
) As User
'Usage
Dim instance As UserCollection
Dim loginName As String
Dim returnValue As User

returnValue = instance.GetByLoginName(loginName)
public User GetByLoginName(
    string loginName
)

Parameters

  • loginName
    Type: System.String

    A string that contains the login name.

    It must not be a null reference (Nothing in Visual Basic).

    It must not be empty.

    Its length must be equal to or less than 251.

Return value

Type: Microsoft.SharePoint.Client.User
A User object that represents the user.

Exceptions

Exception Condition
SPException

The user cannot be found. Error code: -2146232832.

UnauthorizedAccessException

Access is denied. Error code: -2147024891.

See also

Reference

UserCollection class

UserCollection members

Microsoft.SharePoint.Client namespace