1 $WebAppName = "http://yourWebAppUrl"
2 $account = "yourDomain\yourUser"
3 $wa = get-SPWebApplication $WebAppName
4
5 Set-SPwebApplication $wa -AuthenticationProvider (New-SPAuthenticationProvider) -Zone Default
6 #This causes a prompt about migration. Click Yes and continue.
7
8 #The following step sets the user as an administrator for the site.
9 $wa = get-SPWebApplication $WebAppName
10 $account = (New-SPClaimsPrincipal -identity $account -identitytype 1).ToEncodedString()
11
12 #After the user is added as an administrator, we set the policy so that the user can have the correct access.
13 $zp = $wa.ZonePolicies("Default")
14 $p = $zp.Add($account,"PSPolicy")
15 $fc=$wa.PolicyRoles.GetSpecialRole("FullControl")
16 $p.PolicyRoleBindings.Add($fc)
17 $wa.Update()
18
19 #The final step is to trigger the user-migration process.
20 $wa = get-SPWebApplication $WebAppName
21 $wa.MigrateUsers($true)