The Command
Get-Mailbox -RecipientTypeDetails SharedMailbox -ResultSize Unlimited | Select Identity,Alias,DisplayName,PrimarySmtpAddressThis 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 intoExport-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, useGet-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 AmazonAs an Amazon Associate, TechyGeeksHome earns from qualifying purchases.
Discover more from TechyGeeksHome
Subscribe to get the latest posts sent to your email.
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.
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.
Also note that this was from Exchange 2007 on prem to online O365.
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.
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.
Also note that this was from Exchange 2007 on prem to online O365.
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.
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.
Also note that this was from Exchange 2007 on prem to online O365.