How to change SharePoint authentication from classic mode to claims based mode using PowerShell

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 PowerShell

Below is the PowerShell script to change SharePoint authentication from classic mode to claims mode using PowerShell.

You can write, debug, test the PowerShell script using visual studio code or using windows PowerShell ISE.

$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:

Hope this PowerShell tutrial helps to change SharePoint authentication from classic mode to claims based mode in SharePoint using PowerShell.

free sharepoint training

SharePoint Online FREE Training

JOIN a FREE SharePoint Video Course (3 Part Video Series)

envelope
envelope

Rajkiran Swain

Rajkiran is currently working as a SharePoint Consultant in QATAR . Rajkiran having 6 + 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).

>