Using the DS set of tools you need to do a third piping so it is like
dsquery group -name {groupname}| dsget group -members -expand | dsget user -email
Main Topics
Browse All TopicsHello,
I have a couple active directory securtiy group (unfortunately not DLs), and I need to send an email to all users in these groups. I've tried my hand at Users and Computers, ASDI Edit, DSGET and DSQuery - and I haven't been able to get any of them to output anything usable.
I was able to use DSGet to return a list of DNs for all users in a group, but DNs are not emails and it outputed results to the console, where I need it in a text file or ultimaetly in outlook. The command I typed to get this is the following:
dsget group "groupDN" -members -expand
how can I get the emails of these users to a text file?
Thanks!
Tony
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Mike, I tried adfind with the command below and the console hung until I hit ^C:
adfind -default -f "&(objectcategory=person)(
I also tried the above command with the DN immediately encapulated in single and double quotes. once I tried it with single quotes, it produced the .csv, but it was empty... andy ideas?
xxdcmast, I've tried a few variations of your command, but it keeps telling me "failed:'target object for this command' is missing." I'm not currently in the same domain (different region) than the group. Could this be a reference problem? But also, once this type of command does work, how to I get the output into a format that I can use? A format where I can copy/paste into outlook?
Thanks for you help so far!
Tony
Business Accounts
Answer for Membership
by: mkline71Posted on 2009-11-05 at 07:33:50ID: 25750540
I like adfind for this sort of thing
http://www.joeware.ne t/freetool s/tools/ad find/index .htm</A>
ad find -default -f "&(objectcategory=person)( objectclas s=user)(me mberof=DN of your group)" samaccountanme mail -csv > c:\UsersEmail.csv
See if that works for you, will give you a csv of the users samaccountname DN and mail
Thanks
Mike