Bit of an old thread, but i'm doing this just now. I'm in the process of updating my AD fields, i use the addusers command line tool which only fills in the display name, not first/last name.
I created a csv with student logon, name and surname in separate columns, then mailmerged it with the following:
dn: CN=,OU=Year XX Students,OU=School Students,OU=School Users,OU=School Name,OU=Schools,DC=Education
changetype: modify
replace: givenName
givenName:
-
replace: sn
sn:
-
replace: mail
mail: @domain.edu
-
replace: userPrincipalName
userPrincipalName: @domain
-
changeType: modrdn
newRdn: CN= ,OU=Year XX Students,OU=School Students,OU=School Users,OU=School Name,OU=Schools,DC=Education
deleteOldRdn: 1
You need to make sure there's one blank line between each record, then use ldifde to import the file. Command line is
ldifde -i -f filename.txt -s server
You can also add -j for logging, -v for verbose and -k for ignoring the 'object does not exist' error.
Bit longwinded but it seems to work.