Solved

How to export secondary smtp addresses

Posted on 2007-12-05
9
1,562 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
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 
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
 
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

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

Learn to move / copy / export exchange contacts to iPhone without using any software. Also see the issues in configuration of exchange with iPhone to migrate contacts.
Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
This video discusses moving either the default database or any database to a new volume.

770 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