List Shared Mailboxes

List Shared Mailboxes in Exchange Online

This short read will let you understand how exactly to list your Exchange Online shared mailboxes. Simple PowerShell commands are used and all necessary steps are listed for your clear understanding.

Pre-requisites:

In order to connect successfully to Exchange Online with PowerShell, running scripts must be enabled. This can be done by executing the following command in an elevated PowerShell prompt:

Set-ExecutionPolicy -Scope CurrentUser Unrestricted

With that taken care of there is no need to use an elevated prompt to run the commands in the following section:

Creating a List of Shared Mailboxes and Permissions

Perform these simple steps to create a list of all Shared Mailboxes in Exchange Online and a list of all permissions set on the shared mailboxes:

1. Connect to Exchange Online:

Connect-ExchangeOnline

2. Retrieve a list of all shared mailboxes:

Get-Mailbox -RecipientTypeDetails SharedMailbox -ResultSize:Unlimited | ft Name,WindowsEmailAddress

3. To list all permissions assigned to the shared mailboxes use the following command:

Get-Mailbox -RecipientTypeDetails SharedMailbox -ResultSize:Unlimited | Get-MailboxPermission | Select-Object Identity,User,AccessRights | Where-Object {($_.user -like '*@*')

The filter on the last command will ensure you only get “real” user and group permissions and not the big load of built in system accesses on each shared mailbox.

Sample Output

Retrieving a list of shared mailboxes should get you output similar to this:

PS C:\Windows\System32> Get-Mailbox -RecipientTypeDetails SharedMailbox -ResultSize:Unlimited | ft Name,WindowsEmailAddress
Name          WindowsEmailAddress
----          -------------------
Marketing     marketing@mycompany.com
Sales         sales@mycompany.com
Support       support@mycompany.com

And listing the shared mailbox permissions might look like this:

PS C:\Windows\System32> Get-Mailbox -RecipientTypeDetails SharedMailbox -ResultSize:Unlimited | Get-MailboxPermission | Select-Object Identity,User,AccessRights | Where-Object {($_.user -like '*@*')}
Identity      User                                     AccessRights
--------      ----                                     ------------
Marketing     niels.bohr@mycompany.com                 {FullAccess}
Sales         niels.bohr@mycompany.com                 {FullAccess}
Sales         ole.roemer@mycompany.com                 {FullAccess}
Support       tycho.brahe@mycompany.com                {FullAccess}

Summary

That’s all there is to it! If you want to learn how to easily set up shared mailbox permissions using PowerShell check out our other article on Add-MailboxPermission.

If you’re running a hybrid Exchange environment and want to get rid of your local Exchange server and simplify your daily user and mailboxe management try our administration tool, Easy365Manager.

Easy365Manager is available as a fully functional 30-day trial and allows you to manage users, Exchange Online mailboxes and Office 365 licenses inside the native AD Users & Computers tool:

easy365manager ui
User properties, "Office 365" tab
easy365manager ui
User properties, "Mailbox" tab
Did you like this post? Maybe your friends will too!