- start up the exhange administrator program
- go to tools->directory export
- select a file
- uncheck recipients and check distribution lists
- export
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.
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;}’
Oops, I meant print $1 🙂