Migrate from classic-mode to claims-based authentication

Posted by Alvin You
2013. 9. 24. 22:50 Dynamics AX

$wa = Get-SPWebApplication -Identity "http://alvin"
$wa.Properties["portalsuperuseraccount"] = "rainbowcorp\Administrator"
$wa.Properties["portalsuperreaderaccount"] = "rainbowcorp\Administrator"
$wa.Update()

$wa = Get-SPWebApplication -Identity "http://alvin"
$wa.Properties.Remove("portalsuperuseraccount")
$wa.Properties.Remove("portalsuperreaderaccount")
$wa.Update()

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

$account = "rainbowcorp\Administrator"
$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()