MigrateUserAccount Method
The MigrateUserAccount method of the SPGlobalAdmin class migrates a SharePoint user record from one domain account to another domain account.
Parameters
oldLogin A string that contains the old user name (for example, "DOMAIN1\User_1").
newLogin A string that contains the new user name (for example, DOMAIN2\User_2").
enforceSidHistory true to force Windows SharePoint Services to check Active Directory to ensure that the requested user migration has an appropriate security identifier (SID) history. In other words, DOMAIN1\User (oldLogin) can be migrated to DOMAIN2\User (newLogin) only if the DOMAIN2\User account has a SID history that includes DOMAIN1\User. If false, Windows SharePoint Services migrates the user account regardless of what Active Directory includes about the SID history. After the migration is complete, Windows SharePoint Services does not take into account the SID history.
The migration resulting from implementation of this method transpires only in Windows SharePoint Services. The specified user must have already been migrated within Active Directory prior to this operation.
This parameter does not have a default value.
Example
The following code example shows how to use the MigrateUserAccount method to migrate one user account to another one.
Requirements
Platforms: Microsoft Windows Server 2003
Security: Code Access Security