You can search for an Office 365 user by their primary email address or other aliases using Powershell.
First, connect to Office 365 with PowerShell
Once you are connected you can search for a specific address or export all addresses to a CSV file for analysis in another tool.
Find Office 365 User by Email Address
Example PowerShell code to find user by email address:
Get-Mailbox -Identity * | Where-Object {$_.EmailAddresses -like 'SMTP:Testuser@tachytelic.net'} | Format-List Identity, EmailAddresses
The above command will only find this specific email address and that will have to be the primary email address of the mailbox as denoted by the uppercase “SMTP”.
You can also do wildcard searches easily:
Get-Mailbox -Identity * | Where-Object {$_.EmailAddresses -like '*paul*@tachytelic.net'} | Format-List Identity, EmailAddresses
By default Get-Mailbox will only return results from active mailboxes. So you may need to specify the ” -IncludeInactiveMailbox” parameter.
Below is a form you can use to help you put together the command you need.
Export all email addresses to a CSV File
If you prefer, you can simply output the email address of every user to a CSV file and analyse the addresses and aliases in another tool:
get-mailbox -identity *| select-object Identity, EmailAddresses| export-csv EmailAddresses.txt -NoTypeInformation
Brian says
Thank you
vasi says
Hi
Is it possible to find a the email of the identity1?
i.e
Identity : accounts1
User : test@test.com
AccessRights : {FullAccess}
IsInherited : False
Deny : False
InheritanceType : All