I have a client requirement to move from Classic to Claims. I'm currently utilizing some PowerShell from http://derekmartin.org/archives/701
$webApp =
$farm = get-SPFarm
$wa = get-SPWebApplication $webApp
$site = get-SPSite $webApp
$web = $site.OpenWeb()
foreach ($user in $web.AllUsers) {
$newuser = $user
$newuserLoginName = “”
write-host($user.LoginName)
if ($newuser.LoginName.StartsWith(“i:0#.w|”))
{
! $newuserLoginName = $user.LoginName.Substring(7)
}
$user = $newuser
$farm.MigrateUserAccount($user.LoginName, $newuserLoginName, $false)
}
Unfortunately every time I try to run it I get the following
Invalid assignment expression. The left hand side of an assignment operator needs to be something that can be assigned to like a variable or a property. At C:\Users\user\Desktop\claims.ps1:12 char:22 + ! $newuserLoginName = <<<< $user.LoginName.Substring(7) + CategoryInfo : ParserError: (:) [], ParseException + FullyQualifiedErrorId : InvalidLeftHandSide
Any idea on what could be wrong?
Thanks!
Sorry forgot to paste the script in question in originally!
