Here is the script to convert users from windows authentication to claim using PowerShell.
In SharePoint sometimes required to use claims authentication of user, at the time if user has window authentication we can convert its authentication into claim identity.
- $m = [Microsoft.SharePoint.Administration.Claims.SPClaimProviderManager]::Local
- Add-PSSnapin Microsoft.SharePoint.PowerShell -ea silentlycontinue
- $user="User Name Here"
- Function Get-SPClaim
- {
- param ([string]$user)
- $claimType =[Microsoft.SharePoint.Administration.Claims]::SPIdentifierTypes.WindowsSamAccountName
- return $m.ConvertIdentifierToClaim($user, $claimType)
- }
It will return claims identity of user.