SPIisWebServiceApplication.MigrateUserAccount Method

Migrates the user account to a new logon name.

Namespace:  Microsoft.SharePoint.Administration
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: No

Syntax

'Declaration
Protected Friend Overrides Function MigrateUserAccount ( _
    oldPrincipalName As String, _
    newPrincipalName As String, _
    enforceSidHistory As Boolean _
) As Boolean
'Usage
Dim oldPrincipalName As String
Dim newPrincipalName As String
Dim enforceSidHistory As Boolean
Dim returnValue As Boolean

returnValue = Me.MigrateUserAccount(oldPrincipalName, _
    newPrincipalName, enforceSidHistory)
protected internal override bool MigrateUserAccount(
    string oldPrincipalName,
    string newPrincipalName,
    bool enforceSidHistory
)

Parameters

  • enforceSidHistory
    Type: System.Boolean

    Specifies whether security ID history should be enforced.

Return Value

Type: System.Boolean
true if the service migrated the user to the new login name; otherwise, false.

Remarks

The MigrateUserAccount(String, String, Boolean) method will rename any user accounts in the service application delegated administrators access control list (ACL). For example, if user "Bob" has delegated administrator access to a service application, calling this API with the parameters ("Bob", "Robert") would rename entries for "Bob" in the ACL to "Robert".

The MigrateUserAccount(String, String, Boolean) method overrides the MigrateUserAccount(String, String, Boolean) method and, in addition to calling the base class method, it migrates user accounts in the service application ACL to grant access to the service application.

Developers can override either of these methods to hook into the account migration process and, in addition to the default behavior, rename any accounts that they have in their own service application database. So, for example, if a SharePoint Foundation farm administrator invokes the command to rename all "Bob" accounts to "Robert", the overridden method will be called, allowing the service application to rename any references to the "Bob" account in its own database to the new "Robert" account.

If this method is overridden, the base class method should be used.

See Also

Reference

SPIisWebServiceApplication Class

SPIisWebServiceApplication Members

Microsoft.SharePoint.Administration Namespace