Solved

How to export secondary smtp addresses

Posted on 2007-12-05
9
1,560 Views
Last Modified: 2013-11-30
How do I export user's secondary smtp addresses along with their primary smtp address? We have a Windows 2003 AD domain and Exchange 2003 SP2.
0
Comment
Question by:mokn
9 Comments
 
LVL 10

Expert Comment

by:Rogiee
ID: 20417252
Hello mokn,

CSVDE should work for you.  Run it from your Exchange server and save it as a .csv and you should be able to find secondary SMTP addresses.

http://www.ss64.com/nt/csvde.html



Regards,

Rogiee
0
 
LVL 1

Author Comment

by:mokn
ID: 20419869
What I am hoping to find is the exact syntax to use being that I am not familiar with this export tool. Thanks.
0
 
LVL 10

Expert Comment

by:Rogiee
ID: 20419982
csvde -f ADExport.csv
0
 
LVL 1

Accepted Solution

by:
edicer earned 250 total points
ID: 20420200
'Global variables
Dim Container
Dim OutPutFile
Dim FileSystem

'Initialize global variables
Set FileSystem = WScript.CreateObject("Scripting.FileSystemObject")
Set OutPutFile = FileSystem.CreateTextFile("smtpaddresses.txt", True)

'Replace with valid DN of the container you want to enumerate
Set Container=GetObject("LDAP://CN=Users,DC=YourDomain,DC=com")
'Enumerate Container
EnumerateUsers Container

'Clean up
OutPutFile.Close
Set FileSystem = Nothing
Set Container = Nothing

'Say Finished when your done
WScript.Echo "Finished"
WScript.Quit(0)

'List all Users
Sub EnumerateUsers(Cont)
Dim User

'Go through all Users and select them
For Each User In Cont

Select Case LCase(User.Class)

'If you find Users
Case "user"
  'Select all proxyAddresses
  Dim Alias
  If Not IsEmpty(User.proxyAddresses) Then
    'OutPutFile.Write User.DisplayName
    For Each Alias in User.proxyAddresses
        If InStr(1,Alias,"smtp",1) > 0 Then
                  OutPutFile.WriteLine User.DisplayName & vbTab & Replace(Alias,"smtp:","",1,1,1)
                  'WScript.Echo User.DisplayName & vbTab & Replace(Alias,"smtp:","",1,1,1)
            End If
    'WScript.Echo Alias
        Next
  End If

Case "organizationalunit" , "container"

EnumerateUsers User

End Select
Next
End Sub
0
How does your email signature look on mobiles?

Do your employees use mobile devices to reply to emails? With mobile becoming increasingly important to the business world, it is in your best interest to make sure that your email signature looks great across all types of devices.

 
LVL 10

Expert Comment

by:Rogiee
ID: 20481421
Hey there.  How did the CSVDEwork out for ya?
0
 
LVL 1

Author Comment

by:mokn
ID: 20536746
I haven't tried these suggestions yet. I am hoping to get back to this next week after the Holiday's. Please keep this question open for now.

Thanks,
M.
0
 

Expert Comment

by:dniconsulting
ID: 20631229
edicer's script worked for me, if that's any consolation to the question. i did change 'case "user"' to 'case "user", "group"' to include distribution groups, but it works as-is after you fill in the LDAP search string.

thanks a bunch. wish i could assign you points myself!
0
 
LVL 1

Author Closing Comment

by:mokn
ID: 31412970
For our environment our 'Users' OU is two levels down.  I had to change CN= to OU=
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Resolve Outlook connectivity issues after moving mailbox to new Exchange 2016 server
Exchange server is not supported in any cloud-hosted platform (other than Azure with Azure Premium Storage).
To show how to generate a certificate request 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 Servers >> Certificates…
This video discusses moving either the default database or any database to a new volume.

708 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

15 Experts available now in Live!

Get 1:1 Help Now