Share via


RoleDefinitionCollection.GetByName method

Returns the role definition with the specified name from the collection.

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

Syntax

'Declaration
Public Function GetByName ( _
    name As String _
) As RoleDefinition
'Usage
Dim instance As RoleDefinitionCollection
Dim name As String
Dim returnValue As RoleDefinition

returnValue = instance.GetByName(name)
public RoleDefinition GetByName(
    string name
)

Parameters

Return value

Type: Microsoft.SharePoint.Client.RoleDefinition
Returns a RoleDefinition instance representing name of Role.

Exceptions

Exception Condition
[Microsoft.SharePoint.SPException]

Cannot find Role by this name. Error code: -2146232832.

[Microsoft.SharePoint.SPException]

Name must not be empty or bigger than 255 characters. Error code: -2146232832.

Remarks

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. Trimmed name must not be empty.

See also

Reference

RoleDefinitionCollection class

RoleDefinitionCollection members

Microsoft.SharePoint.Client namespace