Exchange Shell – Get all shared mailboxes with primary SMTP

Exchange 2013 1

Last updated on March 30th, 2023 at 05:10 pm

Read Time:59 Second

We recently received a request to provide a project manager with a full list of all shared mailboxes with their primary SMTP addresses that were in Microsoft Exchange.

To do this is a pretty straight forward task using Exchange Management Shell (EMS).

Just go ahead and open your EMS and run the following command:

Get-Mailbox -RecipientTypeDetails SharedMailbox -ResultSize:Unlimited | Select Identity,Alias,DisplayName,primarysmtpaddress | sort displayname

This will go through your Exchange environment and give you a list of all shared mailboxes, their name and the primary SMTP address for each Shared Mailbox.

If you want to export this information to CSV, use the command below:

Get-Mailbox -RecipientTypeDetails SharedMailbox -ResultSize:Unlimited | Select Identity,Alias,DisplayName,primarysmtpaddress | sort displayname | export-CSV C:\TGH\sharedmailboxes.csv

where:

  • C:\TGH\sharedmailboxes.csv = the filepath where you want to save your CSV file

This will then export all the information into a CSV file where you specified in your command line.

Feedback

If you have any questions or feedback on this guide, please feel free to leave us a message below in our comments section and we will get back to you as soon as we can.

Avatar for Andrew Armstrong

About Post Author

Andrew Armstrong

Founder of TechyGeeksHome and Head Editor for over 15 years! IT expert in multiple areas for over 23 years. Sharing experience and knowledge whenever possible! Making IT Happen.
administrator
Click to rate this post!
[Total: 0 Average: 0]

Discover more from TechyGeeksHome

Subscribe to get the latest posts to your email.

9 thoughts on “Exchange Shell – Get all shared mailboxes with primary SMTP

  1. I am wondering what the real value here is. Perhaps there is a call for shared mailboxes specifically, but maybe the PM needed info to which he/she was unaware. Perhaps a permissions report of all mailboxes would be better so that it isn’t only shared mailboxes, but mailboxes with delegation of any type.

    1. Migration to O365 – PM wanted a full list of all shared mailboxes and their primary SMTP addresses, no permissions or proxy/alias addresses. Why? who knows! but this carried out what she requested.

  2. I am wondering what the real value here is. Perhaps there is a call for shared mailboxes specifically, but maybe the PM needed info to which he/she was unaware. Perhaps a permissions report of all mailboxes would be better so that it isn’t only shared mailboxes, but mailboxes with delegation of any type.

    1. Migration to O365 – PM wanted a full list of all shared mailboxes and their primary SMTP addresses, no permissions or proxy/alias addresses. Why? who knows! but this carried out what she requested.

  3. I am wondering what the real value here is. Perhaps there is a call for shared mailboxes specifically, but maybe the PM needed info to which he/she was unaware. Perhaps a permissions report of all mailboxes would be better so that it isn’t only shared mailboxes, but mailboxes with delegation of any type.

    1. Migration to O365 – PM wanted a full list of all shared mailboxes and their primary SMTP addresses, no permissions or proxy/alias addresses. Why? who knows! but this carried out what she requested.

Leave us a message...

This site uses Akismet to reduce spam. Learn how your comment data is processed.