Can you export all email addresses fro Office 365 to a Excel or CSV file

We need to create a list that we can edit with all our email addresses that are in Office 365.  Is this possible to export the email addresses?
J.R. SitmanIT DirectorAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Vasil Michev (MVP)Commented:
You can easily export them via PowerShell, but to give you an example you will need to be a bit more specific as to what you understand by "email addresses" and which attributes you want exported.

You can also just use one of the prebuilt reports available from the Portal (under O365 Admin center -> Reports).
Patrick CronerCommented:
These steps will help you export the list of users and their email addresses from office 365 and to separate the display name by first and last name.

1) Connect to Powershelll

Download and run this script or run these commands
$LiveCred = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri -Credential $LiveCred -Authentication Basic -AllowRedirection
Import-PSSession $Session

2) Run Export Command

Run this command
Get-Mailbox -ResultSize Unlimited |Select-Object DisplayName,PrimarySmtpAddress, @{Name="EmailAddresses";Expression={$_.EmailAddresses |Where-Object {$_.PrefixString -ceq "smtp"} | ForEach-Object {$_.SmtpAddress}}} | Export-Csv email-addresses.csv

3) Seperate first and last names

Using the text to column feature under the data tab separate the first and last names

Best of luck,

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
J.R. SitmanIT DirectorAuthor Commented:
don't see any reports that list "user name" and "email address"  That is what we need.  If you're going to help me via Powershell, I'll need the exact commands to type.  I only slightly familiar with PS.

J.R. SitmanIT DirectorAuthor Commented:
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Office 365

From novice to tech pro — start learning today.