Tech or Treat! Write an article about your scariest tech disaster to win gadgets!Learn more

x
?
Solved

Pull SMTP address out of AD by user

Posted on 2006-10-23
5
Medium Priority
?
930 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 500 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

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…
A quick step-by-step overview of installing and configuring Carbonite Server Backup.
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

647 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