GetUserKeyFromUserName method
TOC
Collapse the table of content
Expand the table of content

SPUtility.GetUserKeyFromUserName method

SharePoint 2013

Gets the user stable identifier, user key, from the userName.

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

'Declaration
Public Shared Function GetUserKeyFromUserName ( _
	userName As String _
) As String
'Usage
Dim userName As String
Dim returnValue As String

returnValue = SPUtility.GetUserKeyFromUserName(userName)

Parameters

userName
Type: System.String

The full user name such as you obtain from [!:SPClaimProviderManager.GetUserIdentifierEncodedClaim(IIdentityidentity)]

Return value

Type: System.String
The user key for the input.

ExceptionCondition
ArgumentNullException

If userName is null.

ArgumentException

If userName is empty.

SPException

If userName is too large or is a not a claims style user name.

Reference

[!:SPWebService.ContentService.MembershipUserKeyType]
Show:
© 2016 Microsoft