Avatar of slackerUH
slackerUH
Flag for United States of America asked on

Exporting Active Directory Users and then reimporting them after a complete domain rebuild

Is there an easy way to export user accounts and/or OU's from Active Directory and then reimport them after a domain rebuild?  I don't want to retype everybodies name over because there are enough other issues I need to deal with when I do this rebuild.
Active DirectoryWindows Server 2003

Avatar of undefined
Last Comment
slackerUH

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
ryansoto

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
mukulag

Or use csvde to export the users along with the required attributes. Use the below command to export the users in the mentioned OU and all the OUs below it. This command contains all the required attributes.

csvde -j c:\ -m -f c:\users.csv -v -s  -d "OU=ROOT OU,DC=MyDomain,DC=local" -r "(objectClass=user)" -p Subtree -l userPrincipalName,sAMAccountName,DN,givenName,sn,displayName

Now open the CSV and make appropriate modifications in the userPrincipalName and DN attributes of all the users. Create similar OU structure in the target domain and run the following command to import the users.

csvde -i -j c:\ -f c:\users.csv -v -k


I understand that this is a very hard way of doing because of the manual combing of all the user accounts. However you would come accross many unused accounts and get rid of them instead of importing all the junk from the old domain to the new domain.
Rajith Enchiparambil

slackerUH

ASKER
Thanks for the info.  This may lead me to a much easier solution.  I have some more questions now.
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy