PowerShell to Upgrade Classic Windows Based SharePoint site to Claims Based Authentication (SharePoint 2013)

During upgrade from SharePoint 2010 to 2013, when we execute the TEST-SPCONTENTDATABASE command, we run into the below exception that says :

"The <Web site> web application is configured with claims authentication mode however the content database you are trying to attach is intended to be used against a windows classic authentication mode.  There is an inconsistency between the authentication mode of target web application and the source web application.  Ensure that the authentication mode setting in upgraded web application is the same as what you had in previous SharePoint 2010 web application…."

UpgradeClaimsError

 

 

 

 

 

 

 

 

 

 

To solve the above error, try running the below powershell:

$WebAppName = "http://YOUR_SHAREPOINT_SITE_URL"
$wa = get-SPWebApplication $WebAppName
$wa.UseClaimsAuthentication = $true
$wa.Update()

Now try executing the TEST-SPCONTENTDATABASE command to perform the upgrade and if it still reports the above error, then execute the following SQL queries and verify if all users are upgraded to "Claims Based Model".

After running the above command,  execute the below SQL SELECT in the SharePoint_Config database:

SELECT TOP 1 [tp_SiteID],[tp_Login] FROM [UserInfo] WITH (NOLOCK) WHERE tp_IsActive = 1 AND tp_SiteAdmin = 1 AND tp_Deleted = 0 and tp_Login not LIKE 'i:%'

The above query, tries to check if there are any rows in the "UserInfo" table which doesnt start with "i:%" (highlighted in yellow).  If you find rows, then it indicates that those users are not available in AD and unless they are deleted, the TEST-SPCONTENTDATABASE will keep throwing the above error.  Run the below command to delete it.

DELETE FROM [UserInfo] WHERE tp_IsActive = 1 AND tp_SiteAdmin = 1 AND tp_Deleted = 0 and tp_Login not LIKE 'i:%'

Once after deleting if you try running the TEST-SPCONTENTDATABASE, you shouldnt see the above error any more.

 

5,177 total views, 7 views today

0 votes

One thought on “PowerShell to Upgrade Classic Windows Based SharePoint site to Claims Based Authentication (SharePoint 2013)

  1. After running the following quesry on my config database I am getting following error

    SELECT TOP 1 [tp_SiteID],[tp_Login] FROM [UserInfo] WITH (NOLOCK) WHERE tp_IsActive = 1 AND tp_SiteAdmin = 1 AND tp_Deleted = 0 and tp_Login not LIKE ‘i:%’
    Invalid object name ‘UserInfo’.

Leave a Reply

Your email address will not be published. Required fields are marked *

Captcha *