Domain User Migration: SharePoint and SIDHistory
One of the basic principles of an Active Directory domain migration is the access to resources in the source domain based on SIDHistory information of the migrated user-account or group. The SID of the object in the source domain is written into the SIDHistory attribute of the object in the target domain. This enables the access to resources in the source domain during the migration process.
Unfortunately, Microsoft breaks with this principle here. SharePoint and SIDHistory.
Index
The SharePoint and SIDHistory problem
Microsoft Sharepoint 2007, 2010 and 2013 do not support the access to SharePoint content based on authorizations given by the SIDHistory. In case user accounts are migrated into another Active Directory domain and the SharePoint farm remains in the source domain for the time being, the migrated user account cannot access SharePoint contents.
The user can still access SharePoint manually with their account from the source domain, but this can only serve as a workaround.
Solution 1 – STSADM
A solution could be the exchange of the user accounts within the SharePoint authorizations. Before there were the new possibilities via Powershell, we could use the command line tool STSADM:
1 |
<span style="color: #0000ff;">stsadm</span> <span style="color: #ff6600;">-o migrateuser</span> <span style="color: #ff6600;">-oldlogin</span> <span style="color: #008000;">Domain\olduser</span><span style="color: #ff6600;"> -newlogin</span> <span style="color: #008000;">Domain\newuser</span> <span style="color: #ff6600;">-ignoresidhistory</span> |
An important note is that the user accounts are exchanged resulting in the source domain account not having access to the SharePoint contents anymore. This has notable influence on the implementation planning and has to be considered at any rate.
Solution 2 – PowerShell (recommended for SharePoint 2010 and higher)
Since SharePoint 2010 Microsoft recommends the usage of PowerShell cmdLets for SharePoint. STSADM can still be used but will not be updated. It will probably be discontinued with one of the next SharePoint versions. Thus I recommend becoming familiar with alternatives of PowerShell.
The cmdLet “Move-SPUser” widely replaces the functions of “stsadm -o migrateuser“.
1 |
<span style="color: #0000ff;">Move-SPUser </span><span style="color: #ff6600;">-Identity </span><span style="color: #008000;">domain\olduser </span><span style="color: #ff6600;">-NewAlias</span> <span style="color: #008000;">domain\newuser </span><span style="color: #ff6600;">-IgnoreSID</span> |
It you work with the cmdLet “Move-SPUser“, you quickly become aware of other similar cmdLets: get-SPUser and set-SPUser. The cmdLet get-SPUser displays a list of the authorizations of one site collection. With a little fantasy you can turn it into a little script reading the authorized user accounts of a site collection, swapping the domain name “old” against “new” and set the new authorizations with move-SPUser.
1 |
<span style="color: #0000ff;">get-SPUser</span><span style="color: #ff6600;"> -web</span> <span style="color: #008000;"><a href="https://webapplication/sites/sitecollection"><span style="color: #008000;">https://webapplication/sites/sitecollection</span></a> </span>|<span style="color: #0000ff;"> select</span> <span style="color: #ff6600;">userlogin</span> |
Depending on whether the Claims Based Authentication of the Web App was activated or not, the output looks as follows:
1 2 3 4 |
UserLogin --------- Domain\username <em>(NTLM) </em>i:0#.w|Domain\username <em>(Claims Based)</em> |
The following script lines are to be an inspiration for a migration script.
Add-PSSnapin Microsoft.SharePoint.PowerShell
$users = get-SPUser -web “https://webapplication/sites/sitecollection“
foreach ($oldUser in $users)
{
$oldUserSTR = $oldUser.userlogin
$newUser = $oldUserSTR.replace(“oldDomain“, “newDomain“)
move-SPUser -Identity $oldUser -NewAlias $newUser -IgnoreSID
}
Link to the Microsoft Technet website about “Move-SPUser“
7 Comments
Leave your reply.