How to export a list from exchange

  1. start up the exhange administrator program
  2. go to tools->directory export
  3. select a file
  4. uncheck recipients and check distribution lists
  5. export
  6. grep ',team,' team.csv | awk -v 'RS=%' -v 'FS=cn=' '{print $2}' where team.csv is the exported file and team is the desired list

This just gets the recipient nicknames. To get the actual email addresses, you’d have to export the recipients as well and write a more sophisticated script to lookup the email addresses from the nicknames.

2 Responses to “How to export a list from exchange”

  1. Jesse Ross says:

    Or for those of us who have trouble remembering awk syntax, we can say grep ‘,team,’ team.csv | perl -F% -lane ‘for (@F) {/cn=(.*)/; print;}’

  2. Jesse Ross says:

    Oops, I meant print $1 🙂