SPFarm.MigrateUserAccount Method
Migrates a user account in SharePoint Foundation to a new login name and binary ID.
Namespace: Microsoft.SharePoint.Administration
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: No
Syntax
'Declaration
Public Sub MigrateUserAccount ( _
oldLogin As String, _
newLogin As String, _
enforceSidHistory As Boolean _
)
'Usage
Dim instance As SPFarm
Dim oldLogin As String
Dim newLogin As String
Dim enforceSidHistory As Boolean
instance.MigrateUserAccount(oldLogin, _
newLogin, enforceSidHistory)
public void MigrateUserAccount(
string oldLogin,
string newLogin,
bool enforceSidHistory
)
Parameters
oldLogin
Type: System.StringA string that contains the old login name.
newLogin
Type: System.StringA string that contains the new login name.
enforceSidHistory
Type: System.Booleantrue to query Active Directory for the SID history attribute to ensure that the new login name corresponds to the old one; otherwise, false.
Remarks
If an entry for the new login name already exists, it is deleted to allow this change. The following entities are updated in the entire server farm: site collection users in the UserInfo tables, people lists, and security policies.