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 publishing feature in SharePoint Online
using .Net managed client object model code
- Activate publishing feature in SharePoint 2013/2016 using PowerShell
- How to delete a SharePoint site using PowerShell
- How to delete a list in SharePoint using PowerShell
- Display warning message in SharePoint site using PowerShell
- How to add links to left navigation or quick launch using PowerShell to all SharePoint sites and subsites
Hope this PowerShell tutrial helps to change SharePoint authentication from classic mode to claims based mode in SharePoint using PowerShell.
Rajkiran is currently working as a SharePoint Consultant in India . Rajkiran having 7+ years of experience in Microsoft Technologies such as SharePoint 2019/2016/2013/2010, MOSS 2007,WSS 3.0, Migration, Asp.Net, C#.Net, Sql Server, Ajax, jQuery etc.He is C#Corner MVP (2 Times).