SPUtility.GetUserKeyFromUserName method
Gets the user stable identifier, user key, from the userName.
Namespace: Microsoft.SharePoint.Utilities
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Syntax
'Declaration
Public Shared Function GetUserKeyFromUserName ( _
userName As String _
) As String
'Usage
Dim userName As String
Dim returnValue As String
returnValue = SPUtility.GetUserKeyFromUserName(userName)
public static string GetUserKeyFromUserName(
string userName
)
Parameters
userName
Type: System.StringThe full user name such as you obtain from [!:SPClaimProviderManager.GetUserIdentifierEncodedClaim(IIdentityidentity)]
Return value
Type: System.String
The user key for the input.
Exceptions
Exception | Condition |
---|---|
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. |
See also
Reference
Microsoft.SharePoint.Utilities namespace
[!:SPWebService.ContentService.MembershipUserKeyType]