Solved

Pull SMTP address out of AD by user

Posted on 2006-10-23
5
851 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

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Join & Write a Comment

Numerous times I have been asked this questions that what is it that makes my machine log on so slow, there have been cases where computers took 23 minute exactly after taking password and getting to the desktop. Interesting thing was the fact th…
Restoring deleted objects in Active Directory has been a standard feature in Active Directory for many years, yet some admins may not know what is available.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

743 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now