How to change SharePoint authentication from classic mode to claims based mode using PowerShell
Check out Best Alternative to InfoPath -> Try Now
This PowerShell SharePoint tutorial we will discuss how we can change SharePoint authentication from classic mode to claims based mode in SharePoint using PowerShell. I will show how to change SharePoint authentication from classic mode to claims based PowerShell.
Recently I migrated the site from SharePoint 2013 to SharePoint 2016 and I faced some problem in authentication type in the targeted SharePoint server.
So after few RND, I got to know the solution to fix this issue. I missed to change the authentication type in targeted server. I executed the below Powershell script to achieve it.
Change SharePoint authentication from classic mode to claims based Power
Below is the PowerShell script to change SharePoint authentication from classic mode to claims mode using PowerShell.
$WebAppName = "http://hqRajdev16" $wa = get-SPWebApplication $WebAppName $wa.UseClaimsAuthentication = $true $wa.Update() $account = "TestAccount\Rajkiran" $account = (New-SPClaimsPrincipal -identity $account -identitytype 1).ToEncodedString() $wa = get-SPWebApplication $WebAppName $zp = $wa.ZonePolicies("Default") $p = $zp.Add($account,"PSPolicy") $fc=$wa.PolicyRoles.GetSpecialRole("FullControl") $p.PolicyRoleBindings.Add($fc) $wa.Update() $wa.MigrateUsers($true) $wa.ProvisionGlobally()
When you execute this command, a confirmation message will appear on the screen. Type Y for confirmation.
After the command executed successfully, check the authentication provider from the SharePoint Central Administration, it will show “claims based authentication”
You may like following PowerShell SharePoint tutorials:
- Activate SharePoint Server Publishing Feature programmatically using C#.Net .net managed object model code
- Activate publishing feature in SharePoint Online
using .Net managed client object model code
- Error while activating SharePoint Server Publishing Feature in SharePoint 2013
- Activate and Deactivate the SharePoint Server Publishing feature
using .Net managed object model in SharePoint 2016
- Unable to activate SharePoint Server Publishing feature site level in SharePoint 2013
- SharePoint 2013/2016: PowerShell check if the feature is activated
- Get SharePoint 2013 feature details from Feature ID or Display Name using PowerShell
- How to activate publishing feature in SharePoint 2013/2016 using PowerShell Script
Hope this PowerShell tutrial helps to change SharePoint authentication from classic mode to claims based mode in SharePoint using PowerShell.
SharePoint Online FREE Training
JOIN a FREE SharePoint Video Course (3 Part Video Series)