• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2827
  • Last Modified:

dsquery, get list of user firstname+lastname,email address, groups belonged to > into a csv file

hi there,

should be an easy 2000 points for someone:

what command or set of commands can i run on my exchange server to export a CSV file which includes one line per user, in something at least close to this format:
firstname lastname, email address, groups belonged to

  • 2
1 Solution
Mike KlineCommented:
Does it have to be dsquery/dsget

I really like adfind (or quest cmdlets/powershell)

for adfind


adfind -default  -f "&(objectcategory=person)(objectclass=user)" givenname sn mail memberof -csv -nodn > c:\users.csv

As you can see I only outputted certain fields but you can add or remove as you want.  Good page that shows what all the attributes are behind the GUI



B HAuthor Commented:
no it doesn't have to be dsquery, i didnt realize adfind existed - whatever is easier,  someone asked for this list and the quicker i can get it off my plate the better :)

i'll go try adfind right now
B HAuthor Commented:
that worked great, thanks!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now