Translate

Thursday, October 22, 2015

How to Export Active Directory user information to a CSV File


Probably you may be tempted to try to export users using the  dsquery command, but   is not the best way.


When I was trying to do this, I found  a specific command to perform  this task.

CSVDE is one of the best option to export  AD users via command line. It is necessary to note that  CSVDE  has to be executed on your domain controller,otherwise it will not work.

This is the syntax:


csvde -d "OU=Finance,OU=Users,DC=Mydomain,DC=Com" -l dn,userAccountControl,sAMAccountName,userPrincipalName,whenCreate -r "(&(objectCategory=Person)(objectClass=user))" -f usersExported.csv -u


Parameters:

-d:   Distinguished name
-l :   Ldap attributes
-r :  Ldap attributes list
-f :  File name
-u : Unicode format


No comments:

Post a Comment