How to retrieve all the email address from exchange server


Any can one hep me that.. how to get all user mail id from exchange sever?
I need to export into excel or word? is it possible?

Who is Participating?
Rajitha ChimmaniConnect With a Mentor Commented:
If you are looking for just the primary SMTP address of the users, you can use the below command to export the email addresses to a csv file.

Get-Mailbox -Resultsize unlimited -Filter {Recipienttypedetails -eq UserMailbox} | Select Name,PrimarySMTPAddress | Export-csv Users.csv

If you are looking for all email addresses to be listed, you can use the below command
Get-Mailbox -Resultsize unlimited | Select Name -expand emailaddresses | where {$_.smtpaddress} | Ft Name,SMTPAddress | export-csv Users.csv
kbmsudha84Author Commented:

Thanks.. where should i run?  Is it in Exchange server using cmd window?

I tried in exchange server side. but its say bad command line
Rajitha ChimmaniCommented:
Open Exchange Management Shell and copy the entire command
Manpreet SIngh KhatraSolutions Architect, Project LeadCommented:
You can also run with

CSVDE -F C:\User.csv ............. use filters with -L for attributes you want

- Rancy
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.