We are currently looking at migrating SharePoint user account(AD user) from domain\x to domain\y.
I am using the SPFarm.MigrateUserAccount to do the same. Below is the code snippet.
This code runs fine when System account logs in however fails if any other user runs the same piece of code.
Error:The specified old login name could not be found. No records had been updated.
If you have come across a similar problem please provide assistance.
Note: Power shell and stsadm commands are ruled out . Need to do it through a web app. Hence a c# solution is what we are looking at.
Code snippet:
SPFarm Farm = SPFarm.Local;
if (myFarm
!= null)
myFarm.MigrateUserAccount("Domain\\x", "Domain\\y", true);
Environment:
· SharePoint Server 2010
· Windows Server 2008 Standard R2









