I have to do a script to migrate user because of change domain. From DOM1\user1 to DOM2\user2

When i do

$web = $spsite.openweb()
        $userToReplace = $web.EnsureUser($oldLogin)

            $userReplaced = "i:0#.w|$newLogin"
            #$userToReplace ="i:0#.w|$oldLogin"
            Move-SPUser -Confirm:$false -Identity $userToReplace -NewAlias  $userReplaced -IgnoreSID 

It changes the permission to the new account but when i go to a listitem updated by DOM1\user1 If i click on the Modified by, it goes to the old userid and not the new

1 Answer 1


I have found something that worked for me.

It is kind of forcing it to sync again:

Get-SPUser –Web http://sharepointsite | Set-SPUser –SyncFromAD

You will probably get some error like Set-SPUser : Cannot get the full name or e-mail address of user "c:0(.s|true"., but nothing to worry about

  • Thanks for your proposition. I have user profile is it ok with this? Jun 13, 2016 at 10:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.