Is the last post we looked at a vanilla user account migration, assuming a clean target domain.
There may be a situation where the users have already been created in the target domain with a different sAMAccountName. For example, the user Branch Warren might have the sAMAccountName of bwarren in the source domain but branch.warren in the target.
To get around this you can use an include file to map these different sAMAccountNames together when migrating. The include file is in the following format, and if we use the example above would look like this:
Creating the Include File
To generate this list you can use CSVDE to pull out the required information from the two forests. The final include file will require a bit of manual preparation to get into the correct format.
From the source domain:
csvde -d "OU=source,DC=source,DC=local" -f sourceinclude.csv -l "sAMAccountName"
From the target domain:
csvde -d "OU=target,DC=target,DC=local" -f targetinclude.csv -l "sAMAccountName, userPrincipalName"
Create the include CSV file in the same format as the example above, I’ve created three users which I need to migrate and merge with an include file.
Once you have this in place, the migration process is very similar to the method outlined in the last blog post. When you are asked to select users, choose Read objects from an include file, specify the Include file you created above.