In sharepoint 2013 i need to replace a user by an other. For this i use:
Move-SPUser -Identity "DOMAIN\JaneDoe" -NewAlias "Domain\JaneSmith" -IgnoreSID
I give permission on a site to JaneDoe puting him in a group. After executing the command the user is remove from the group so he doesn't have anymore access but new user doesn't have access in his place! If i get the permission again to JaneDoe his name is now JaneSmith
Could you give me a sample to replace a user by an other like stsadm -o migrateuser in SP2007
Solution:
$user = Get-SPUser -Identity "i:0#.w|domain\janedoe" -Web http://webUrl Move-SPUser -Identity $user -NewAlias ":i:0#.w|domain\janesmith" -IgnoreSid