UserCollection.GetByEmail method

Returns the user with the specified e-mail address.

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

Syntax

'Declaration
Public Function GetByEmail ( _
    emailAddress As String _
) As User
'Usage
Dim instance As UserCollection
Dim emailAddress As String
Dim returnValue As User

returnValue = instance.GetByEmail(emailAddress)
public User GetByEmail(
    string emailAddress
)

Parameters

  • emailAddress
    Type: System.String

    A string that contains the e-mail address of the user.

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

Return value

Type: Microsoft.SharePoint.Client.User
Returns a User.instance representing the user with the specified e-mail address.

Exceptions

Exception Condition
[Microsoft.SharePoint.SPException]

User cannot be found. Error code: -2146232832.

[System.UnauthorizedAccessException]

The current user has insufficient permissions. Error code: -2147024891.

See also

Reference

UserCollection class

UserCollection members

Microsoft.SharePoint.Client namespace