List all AD users & email addresses

Simply put this into the Start -> Run bar and hit enter! to get a print out of users & email addresses within the domain.

  • cmd /c dsquery.exe * -limit 0 -filter “(&(objectCategory=person)(objectClass=user)(mail=*))” -attr name mail >”c:\PrimaryEmailAddresses.txt”
  • cmd /c csvde.exe -r “(&(objectCategory=person)(objectClass=user)(mail=*))” -l name,mail -f “c:\PrimaryEmailAddresses.csv”

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.