How to use CSVDE to export users from Active Directory


It is a common problem if I deal with a project about how to export-import users from different domain to a new one. Kind of brain scratching dealing with ADMT so if the customer agrees we can create new users to our new Domain, with new password, with the legacy user’s attributes. First simple trick is to analyze what kind of User’s attributes are being used. First of all take a look to a common user (or 10) and note every attributes which are being used.

If you find them then let’s prepare the export command

csvde -f c:\temp\exportedusers.csv -u -p subtree -r "(&(objectCategory=person)(objectClass=User)(givenname=*))" -l "cn,givenName,samAccountName,telephoneNumber,description,mail,mobile,physicalDeliveryOfficeName,ObjectClass,displayName,SN"

So what does it do? csvde is our command -f is the file name –> c:\temp\exportedusers.csv is the file (CSV extension) -u is for the special characters (öüóőúáé etc) called Unicode, -p is the default SubTree meaning all Active Directory Information, -r and after all that strange characters are for filters on LDAP properties and the last -l means for listing only the following LDAP attr.

cn=Full Name

givenName=First Name

samAccountName=User ID




mobile=mobile telephone


ObjectClass=Will be User as already filtered after the “-r”

DisplayName=Full Name

SN=Last Name

After this export we will get a CSV file. I usually save as xlsx as we will not use the csvde import command to import this, we will go with a different way.

On the next Blog post I will show you a little Excel trick to create new AD Users with the exported attributes.


3 thoughts on “How to use CSVDE to export users from Active Directory

  • 8th December 2019 at 11:14 am

    It’s a pity you don’t have a donate button! I’d definitely donate to this excellent blog! I guess for now i’ll settle for bookmarking and adding your RSS feed to my Google account. I look forward to brand new updates and will talk about this blog with my Facebook group. Chat soon!

  • 8th December 2019 at 3:59 pm

    you’re in reality a just right webmaster. The website loading speed is amazing. It seems that you are doing any distinctive trick. Moreover, The contents are masterpiece. you have done a excellent process in this subject!

  • 11th December 2019 at 1:01 am

    Do you have a spam problem on this website; I also am a blogger, and I was curious about your situation; many of us have developed some nice procedures and we are looking to exchange methods with other folks, be sure to shoot me an e-mail if interested.


Leave a Reply

Your email address will not be published. Required fields are marked *