Exchange Shared Mailboxes: Listing Every Primary SMTP Address

Pulling a full list of shared mailboxes with their primary SMTP addresses is a common request, and Exchange Management Shell (EMS) makes it a one-line job. The Command Get-Mailbox -RecipientTypeDetails SharedMailbox -ResultSize Unlimited | Select Identity,Alias,DisplayName,PrimarySmtpAddress This returns every shared mailbox in the organisation with its identity, alias, display name, and primary SMTP address in […]

Exchange Shell Get All Shared Mailboxes With Primary Smtp
Pulling a full list of shared mailboxes with their primary SMTP addresses is a common request, and Exchange Management Shell (EMS) makes it a one-line job.

The Command

Get-Mailbox -RecipientTypeDetails SharedMailbox -ResultSize Unlimited | Select Identity,Alias,DisplayName,PrimarySmtpAddress
This returns every shared mailbox in the organisation with its identity, alias, display name, and primary SMTP address in one pass.

Exporting to CSV

Pipe the same command into Export-Csv to hand the list off to a project manager or for record-keeping:
Get-Mailbox -RecipientTypeDetails SharedMailbox -ResultSize Unlimited | Select Identity,Alias,DisplayName,PrimarySmtpAddress | Export-Csv -Path "C:\SharedMailboxes.csv" -NoTypeInformation

On Exchange Online, use Get-EXOMailbox instead

Get-Mailbox still works against Exchange Online and will give you the same result, but Microsoft’s own guidance is to move scripts over to the REST-based Get-EXOMailbox cmdlet where you can — it’s reported to run three to four times faster against large tenants and holds up better through transient service issues that can otherwise cause a long-running Get-Mailbox pull to fail partway through. The equivalent command is:
Get-EXOMailbox -RecipientTypeDetails SharedMailbox -ResultSize Unlimited -Properties PrimarySmtpAddress | Select Identity,Alias,DisplayName,PrimarySmtpAddress
Get-EXOMailbox ships as part of the Exchange Online PowerShell module (the same one you connect with via Connect-ExchangeOnline), so no extra install is needed — it’s simply a different cmdlet within the module you’re probably already using.

Which one should you use?

For a one-off pull on a small tenant, either cmdlet is fine — the difference isn’t noticeable at a few hundred mailboxes. For anything run regularly, at scale, or as part of an automated reporting script, use Get-EXOMailbox: it’s the version Microsoft is actively investing in, and Get-Mailbox/legacy Remote PowerShell cmdlets are the ones more likely to be deprecated further down the line.
🛠️

Gear We Recommend

A few general tech accessories worth having alongside this.

Browse our General Tech Accessories picks on Amazon

As an Amazon Associate, TechyGeeksHome earns from qualifying purchases.


Discover more from TechyGeeksHome

Subscribe to get the latest posts sent to your email.

Andrew Armstrong

Andrew Armstrong is a UK-based IT professional with 26+ years of hands-on experience in Windows, Windows Server, SCCM/ConfigMgr, Active Directory, PowerShell, and enterprise infrastructure.

He founded TechyGeeksHome in 2010 and has published over 1,500 practical guides covering real-world IT problems and solutions. When not solving IT problems,

Andrew develops free Windows utilities including Ultimate Settings Panel, which has been downloaded over 850,000 times.

9 thoughts on “Exchange Shared Mailboxes: Listing Every Primary SMTP Address

  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.

Comments are closed.