Converting A Classic Auth Content Database to Claims Auth in SharePoint 2013

In previous blogs for SharePoint 2010 I’ve talked about how to do claims migration – and others.  In SharePoint 2013 we have a new cmdlet for doing that called Convert-SPWebApplication, which I may cover at a future time.  As you can tell from the name though, that cmdlet’s scope is the web application.  We believe of course that as you attach content databases to create your new SharePoint 2013 farms, you will want a “lighter” method to migrate databases that still use Windows classic authentication.  In this scenario, I’ll assume that you already have a Windows claims web application running in SharePoint 2013 and you’ve already attached your SharePoint 2010 content database using the Mount-SPContentDatabase cmdlet.  So – assuming you have 1 content database from when you created the SPWebApplication and you just added your 2nd that is Windows Classic mode, here’s how you can convert only that content database to using Windows claims.  Please NOTEsuper important – that you use “$arguments” for the arguments parameter.  I’m not the brightest PowerShell guy in the world (not even close), so I stubbed my toe and banged my head on the desk repeatedly because I called mine “$args”.  After one hour of bloody toe and forehead I realized that it all works if I just called it $arguments.  Somewhere, somehow, I’m sure someone will tell me this is my fault.  🙂

$wa = Get-SPWebApplication http://yourWebAppUrl
$acc = ‘domain\user’
$arguments = New-Object Microsoft.SharePoint.Administration.SPWebApplication+SPMigrateUserParameters

#based on scenario above, content DB 0 is the one that was created with the web app, so 1 is the DB that was added with Mount-SPContentDatabase

$wa.MigrateUsersToClaims($acc, $true, $arguments)

After you run this you should be good to go.  I tested on a content DB with a handful of users and a combination of SharePoint groups and unique permissions and it all worked great.  And by the way, yes, that really is a plus sign between SPWebApplication and SPMigrateuserParameters.


4 thoughts on “Converting A Classic Auth Content Database to Claims Auth in SharePoint 2013

  1. Hello Steve,
    I am trying to execute this script cross-domain (with a one way-trust) with the appropriate Farm Account and the PowerShell command shell invoked with the “Run As Administrator” privileges and yet I end up with the result as $false.
    Any suggestions on getting this script to execute successfully across domains?

    Thank you for your contributions so far!


  2. Hello Steve… thanks for mentioning the steps… after I run the last command to migrate users… the result was false… could you please suggest anything on this?


  3. What does this part mean:
    $acc = ‘domain\user’

    Do we put in the farm admin creds in there? Or is that the format of how we want the users to be converted into claims? If that is the format to convert to claims, can we use UPN instead, e.g.:

    $acc = ‘UPN’ ?


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s