Link to home
Start Free TrialLog in
Avatar of r-k
r-k

asked on

Script to list addresses in Distribution List

I am looking for a script to list the emails for all members of a Distribution List. I ran across a wonderful script at http://krisdev.blogspot.com/ which does it, almost. It lists local users, but leaves out contacts. If anyone can extend it to include the contacts it would be perfect. Thanks.
SOLUTION
Avatar of kristinaw
kristinaw
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Avatar of Chris Dent
Chris Dent
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of r-k
r-k

ASKER

Chris,

Thank you very much. Your script works wonderfully and correctly. I hope you don't mind my giving some of the points to Kris because it was her script that got me thinking again about this long-pending project. Thanks again!
have a look at my blog to see my revision, just used the nameTranslate method to convert the NT name of the group to the distinguishedName. Check it out Chris.

http://krisdev.blogspot.com/

Thanks!

Didn't realize nameTranslate works on groups as well, very convenient!


Course I don't mind, I'm glad it all helped :)

That's pretty neat Kris, I'll have to look into it. Just because you also have the same thing on your blog... The script above was originally written to find an SMTP address within a Domain. Using the SQL query is a lot faster than recursing through AD... most of the time.

Chris
oh, are you talking about the script i wrote to search for an smtp address? yes, i do most of my scripts using the sql type search method, i actually got that ourecurse idea from you and just wanted to try it out in something. It's cool just trying the different methods to accomplish something, never know when you might HAVE to use one method over another just to get something to work :)

Kris.
cool thing about this group enumerate script, long as you put in the preWindows2000 (which is often also the group 'alias') name of the group it will just convert it directly to the DN, no searching required.
Avatar of r-k

ASKER

Kris,

Thanks for the update. I just tried your new version, and it works very correctly. Plus it puts out both the username and the email address.