?
Solved

extracting email addresses

Posted on 2006-05-26
4
Medium Priority
?
277 Views
Last Modified: 2010-08-05
Hello,

I haven't created a log for all the email addresses for the company. Now I want to create one, and I am wondering if there is way or a tool, to extract the email addresses from the Exchange 2003 server.
I will go through every account if that is the only way.

Can anyone help with this?

Thanks,

Nelson
0
Comment
Question by:Aguillon1949
4 Comments
 
LVL 6

Assisted Solution

by:MikeeMiracle
MikeeMiracle earned 200 total points
ID: 16771014
You can query AD for information using LDAP so you need to write/find a util that pulls this information out of AD using LDAP queries.
0
 
LVL 18

Assisted Solution

by:amaheshwari
amaheshwari earned 400 total points
ID: 16771631
Try this link :

Creating a list of Users and their e-mail addresses in Exchange :

http://www.msexchange.org/tutorials/Creating_a_list_of_Users_and_their_email_addresses_in_Exchange_2000_2.html

Thanks
Ashish
0
 

Author Comment

by:Aguillon1949
ID: 16772156
Ashish,

Good article. I have a couple of questions not addressed in the article; the script should be saved as what? what is the extension?
Also how do you execute the file?


Thanks,

Nelson
0
 
LVL 4

Accepted Solution

by:
g127404 earned 400 total points
ID: 16773030
From:
http://www.msexchange.org/tutorials/Creating_a_list_of_Users_and_their_email_addresses_in_Exchange_2000.html
The first document walks you through making the script, the second one that Ashish gave is to modify it with your own LDAP query.

Copy and paste this code into a text document.
Name it "getusers.vbs"


Dim rootDSE, domainObject
Set rootDSE=GetObject("LDAP://RootDSE")
domainContainer = rootDSE.Get("defaultNamingContext")
Set domainObject = GetObject("LDAP://" & domainContainer)
Set fs = CreateObject ("Scripting.FileSystemObject")
Set userFile = fs.CreateTextFile ("c:\users.csv")
ExportUsers(domainObject)
Set oDomain = Nothing
MsgBox "Finished"
WScript.Quit
Sub ExportUsers(oObject)
Dim oUser
For Each oUser in oObject
Select Case oUser.Class
Case "user"
If oUser.mail <> "" then
userFile.Write "," & oUser.displayName & "," & oUser.sAMAccountName & "," & oUser.userprincipalname & ","
for each email in oUser.proxyAddresses
userFile.Write email & ","
next
userFile.WriteLine ""
End if
Case "organizationalUnit" , "container"
If UsersinOU (oUser) then
ExportUsers(oUser)
End if
End select
Next
End Sub
Function UsersinOU (oObject)
Dim oUser
UsersinOU = False
for Each oUser in oObject
Select Case oUser.Class
Case "organizationalUnit" , "container"
UsersinOU = UsersinOU(oUser)
Case "user"
UsersinOU = True
End select
Next
End Function




At a command prompt navigate to where you've saved this and run it by using:
cscript getusers.vbs
It creates a comma delimited file in your C:\ drive.
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

On September 18, Experts Exchange launched the first installment of the Help Bell, a new feature for Premium Members, Team Accounts, and Qualified Experts. The Help Bell will serve as an additional tool to help teams increase question visibility.
Stellar Exchange Toolkit: this 5 in 1 toolkit comes loaded with mega-software tool. Here’s an introduction to tools’ usage and advantages:
In this video we show how to create an Address List in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Organization >> Ad…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Suggested Courses

829 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