skip to Main Content

Find specific SMTP address with PowerShell

How to find a specific SMTP address with PowerShell in the Exchange Organization? You want to know how many mailboxes are configured with a specific SMTP address. In this article, you will learn how to search and list mailboxes in Exchange Server with a specific SMTP address.

Do you want to list all SMTP addresses in the Exchange Organization? Read how to list all SMTP addresses with PowerShell »

Find specific SMTP address with PowerShell

We like to find mailboxes with a specific SMTP address in Exchange Server. These are the primary SMTP address and the secondary SMTP address, also known as alias address.

Run Exchange Management Shell as administrator. Run the cmdlet to list the mailboxes with that particular domain.

Tweak the table view and add the information you need to the Select-Object cmdlet. For example, DisplayName, PrimarySMTPAddress, and EmailAddresses.

Another view to make it look a bit cleaner.

Export to CSV file

We like to export the mailboxes with a specific SMTP address to CSV. This will export the CSV file to C:\temp\. Don’t forget to create a temp folder on the C drive or edit the export path.

Open the exported CSV file with Microsoft Excel or another CSV file viewer/editor.

Find specific SMTP address with PowerShell CSV file

I hope it helped you to search and list the mailboxes that have a specific SMTP address configured.

Keep reading: How to bulk remove secondary SMTP address with PowerShell »

Conclusion

In this article, you learned how to find a specific SMTP address with PowerShell in Exchange Server. Run the cmdlet in PowerShell to get a list of the mailboxes with a specific SMTP address. Adjust the Select-Object cmdlet with the values you want to see. After that, export the list to CSV file and open it with your favorite CSV viewer/editor.

Did you enjoy this article? You may also like Bulk create AD Users with random passwords. Don’t forget to follow us and share this article.

ALI TAJRAN

ALI TAJRAN

ALI TAJRAN is a passionate IT Architect, IT Consultant, and Microsoft Certified Trainer. He started Information Technology at a very young age, and his goal is to teach and inspire others. Read more »

This Post Has 2 Comments

  1. Your script doesn’t return the EmailAddresses but only the PrimarySmtpAddress. I’m trying to export list of migrated users from our environment, which are having a secondary email address from their previous tenant. Users seems to be identified correctly, but all the secondary email addresses are not listed in the export.

    1. As you can see from the imported CSV file in Microsoft Excel, it did work correctly. Unfortunately, it’s not working on your end. It’s difficult for me to give you an answer or tweak the cmdlet to your needs without reproducing the issue.

Leave a Reply

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

Back To Top