Skip to content

Instantly share code, notes, and snippets.

@russom-woldezghi
Created February 1, 2013 18:56
Show Gist options
  • Save russom-woldezghi/4693262 to your computer and use it in GitHub Desktop.
Save russom-woldezghi/4693262 to your computer and use it in GitHub Desktop.
Export Active Directory contacts to a .txt file using firstname, lastname, mail, etc.
dsquery * domainroot -filter "(&(objectCategory=Contact)(objectClass=Contact))" -attr cn displayName givenName sn mail canonicalName distinguishedName legacyExchangeDN -limit 0 > "C:\Path\to\all_contacts.txt"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment