Skip to content

Instantly share code, notes, and snippets.

@russom-woldezghi
Created February 1, 2013 18:52
Show Gist options
  • Save russom-woldezghi/4693240 to your computer and use it in GitHub Desktop.
Save russom-woldezghi/4693240 to your computer and use it in GitHub Desktop.
Export Active Directory users accounts details such as email, username, objectid, etc.
dsquery * domainroot -filter "(&(objectCategory=Person)(objectClass=User))" -attr cn displayName givenName sn userPrincipalName sAMAccountName mail ProfilePath scriptPath homeDrive homeDirectory uniqueMember canonicalName distinguishedName objectSid legacyExchangeDN description -limit 0 > "C:\Path\to\files\All_Users.txt"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment