Exchange – Export Email Addresses to Excel
Powershell command to export all user email addresses to an Excel sheet. Below uses OrganizationalUnit, you could change the Get-Mailbox criteria to Server, Database, or whatever your requirements.
Get-Mailbox -OrganizationalUnit 'contoso.com/users' -ResultSize Unlimited | Select-Object DisplayName,ServerName,PrimarySmtpAddress, @{Name=“EmailAddresses”;Expression={$_.EmailAddresses | Where-Object {$_.PrefixString -ceq 'smtp'} | ForEach-Object {$_.SmtpAddress}}} | Export-Csv -Path some-file.csv