Solved

Pull SMTP address out of AD by user

Posted on 2006-10-23
5
875 Views
Last Modified: 2010-05-18
I am I am looking for a way to pull all the SMTP address out of AD by user.  What is the best way to do this?
Thanks
0
Comment
Question by:sysdj
5 Comments
 
LVL 43

Expert Comment

by:Steve Knight
ID: 17789585
You can use dsquery / dsget, e.g.

dsquery group -name "domain users" | dsget group -members | dsget user -fn -ln -email

find the domain users group, passes the full name of that into dsget to get the members and passes that into dsget to return the first name, lastname and email address,  You can pipe that into a text file with

> textfile.txt

on the end of the line

hth

Steve
0
 

Author Comment

by:sysdj
ID: 17791601
I am looking for all the SMTP address in use by accounts.  I may be mistaken, but I believe the switch email will only get the default.
0
 
LVL 43

Expert Comment

by:Steve Knight
ID: 17791870
That isn't what you said first so I need to understand what you want exactly?  A list of all multiple email addresses per user?  For which users, members of a group or all users?


0
 
LVL 14

Expert Comment

by:inbarasan
ID: 17793103
Dear sysdj,
Let me explain you what we use internally at our office. Normally there will be an alias created by default with the userid@yourdomain.com So we use this logic and create the list or send the mail to user. Hope this tip helps. Good luck.

Cheers!
Inba
0
 
LVL 10

Accepted Solution

by:
ryangorman earned 125 total points
ID: 17794066
dsquery * -filter "(&(objectCategory=person)(objectClass=User)(mailNickname=*))" -attr sAMAccountName proxyaddresses -limit 0

Finds all mailbox-enabled users and outputs their account name and a semi-colon delimited field with all their addresses. You'll need to parse this output to filter out non SMTP addresses.
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

So you have two Windows Servers and you have a directory/folder/files on one that you'd like to mirror to the other?  You don't really want to deal with DFS or a 3rd party solution like Doubletake. You can use Robocopy from the Windows Server 200…
Scenerio: You have a server running Server 2003 and have applied a retail pack of Terminal Server Licenses.  You want to change servers or your server has crashed and you need to reapply the Terminal Server Licenses. When you enter the 16-digit lic…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question