Compare the Exchange Alias to the Primary SMTP Address

Here’s a data quality report for an Exchange environment. This command looks for Alias values that do not match the “username” portion of the PrimarySMTPAddress values. Any discrepancies are returned.

Get-Mailbox -ResultSize unlimited | where {$_.PrimarySmtpAddress.ToString() -notlike $_.Alias.ToString()+"@*"} | ft name, Alias, PrimarySmtpAddress

About Tommy Doan

BF-ITS(Systems)
This entry was posted in PowerShell. Bookmark the permalink.

One Response to Compare the Exchange Alias to the Primary SMTP Address

  1. Mohamed Elhity says:

    thanks for such a handy command, saved me tons of time!

Leave a Reply

Your email address will not be published. Required fields are marked *