Compartilhar via


Utility.SearchPrincipals Method

Returns the collection of principals that partially or uniquely match the specified search criteria.

Namespace:  Microsoft.SharePoint.Client.Utilities
Assemblies:   Microsoft.SharePoint.Client.Silverlight (in Microsoft.SharePoint.Client.Silverlight.dll);  Microsoft.SharePoint.Client (in Microsoft.SharePoint.Client.dll)

Syntax

'Declaration
<RemoteAttribute> _
Public Shared Function SearchPrincipals ( _
    Context As ClientRuntimeContext, _
    web As Web, _
    input As String, _
    scopes As PrincipalType, _
    sources As PrincipalSource, _
    usersContainer As UserCollection, _
    maxCount As Integer _
) As IList(Of PrincipalInfo)
'Usage
Dim Context As ClientRuntimeContext
Dim web As Web
Dim input As String
Dim scopes As PrincipalType
Dim sources As PrincipalSource
Dim usersContainer As UserCollection
Dim maxCount As Integer
Dim returnValue As IList(Of PrincipalInfo)

returnValue = Utility.SearchPrincipals(Context, _
    web, input, scopes, sources, usersContainer, _
    maxCount)
[RemoteAttribute]
public static IList<PrincipalInfo> SearchPrincipals(
    ClientRuntimeContext Context,
    Web web,
    string input,
    PrincipalType scopes,
    PrincipalSource sources,
    UserCollection usersContainer,
    int maxCount
)

Parameters

  • input
    Type: System.String

    Specifies the value to be used when searching for a principal.

    If this is not the display name, e-mail address, or login name of a principal, the server must return NULL.

    It must not be NULL. Its length must be equal to or less than 255.

  • maxCount
    Type: System.Int32

    Specifies the maximum number of principals to be returned in the list.

    If the value is equal to or less than 0, the server must return an empty collection.

Return Value

Type: System.Collections.Generic.IList<PrincipalInfo>
Returns a IList<T> instance representing the collection of principals that partially or uniquely match the specified search criteria.

Exceptions

Exception Condition
[System.UnauthorizedAccessException]

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

See Also

Reference

Utility Class

Utility Members

Microsoft.SharePoint.Client.Utilities Namespace