KB Article #101030
How to export all e-mail addresses from Active Directory to a text file to be imported in MailGate
</p><p> Question & Answer</p><p>
How to export all e-mail addresses from Active Directory to a text file to be imported in MailGate
Question
How do I export all e-mail addresses from my Active Directory to a text file to be imported in MailGate?
Answer
On a Windows system that is part of the domain, open a command prompt and issue the following command:
dsquery user "AD_Container" -limit 0| dsget user -Email > C:\emails.txt
Here, AD_container is the container that holds the e-mails to be exported, for example DC=domain,DC=com applies for all the users email addresses found in domain.com. The list with the corresponding email addresses will be stored in the C:\emails.txt file. Open the file and remove the first line only - the one named "email" and save it. The file is now ready and in proper format to be directly imported in MailGate.
To import the email addresses from that file in MailGate, navigate to Administration -> Users and Groups in the Admin UI and click on the "Import Users..." link button, browse to the location the emails.txt file is stored (C:\emails.txt in this example) and click "Import". When the import is completed, you should see a confirmation including the number of users imported.