List Your Office 365 Email Addresses

Office 365

 

It’s sometimes difficult to find out exactly who is the owner of a particular email address, particularly when your Office 365 deployment has multiple domains and hundreds of users.  This is an easy process to dump everything to a file and then locate the owner.  You can list all your Office 365 email addresses and their owners by using just a few easy PowerShell commands.

Connect to Office 365 through PowerShell

The first step is to connect to Office 365 with PowerShell as described in our earlier post: http://symmetrixtech.com/connect-to-office-365-and-azure-with-powershell/

Dump the User and Distibution List Addresses to a File

Get-Mailbox -ResultSize Unlimited |Select-Object DisplayName,PrimarySmtpAddress, @{Name=”EmailAddresses”;Expression={$_.EmailAddresses |Where-Object {$_.PrefixString -ceq “smtp”} | ForEach-Object {$_.SmtpAddress}}} | Export-Csv c:emaillist.csv

That will create a CSV file in the root of your C: drive called “emaillist.csv” that you can open up in Excel or a similar spreadsheet.

It does not dump distribution list email addresses but you can do that with this command:

Get-DistributionGroup | FL Name,DisplayName,GroupType,PrimarySmtpAddress | Export-Csv c:distrolist.csv

By |2015-03-23|Office 365|