Updated 2 months ago

Get Shared Mailbox in Office 365 using PowerShell

by Kathy Cooper

4 min read

No Comments

Often Microsoft 365 admins in situations to get all list of shared mailboxes in their Exchange Online environment. Even with a simple cmdlet, you can list the shared mailboxes. For example,

Before using the above cmdlet, you must connect to Exchange Online PowerShell. But the result will not be as you expected. To ease your work, we have created a PowerShell script. It will export shared mailbox reports to CSV with the most required attributes.

Script Download: GetSharedMailboxReport.ps1

Script Highlights:

  • The script uses modern authentication to connect to Exchange Online.
  • The script can be executed with an MFA-enabled account too.
  • Exports report results to CSV file.
  • It helps to identify shared mailboxes with licenses separately.
  • Helps to track email forwarding configured shared mailboxes.
  • Automatically installs the EXO V2 module (if not installed already) upon your confirmation.
  • The script is scheduler-friendly. I.e., Credentials can be passed as a parameter instead of getting interactively.

Export Office 365 Shared Mailboxes Report – Sample Output:

The exported shared mailbox details report will contain the following attributes:

Mailbox name, Primary SMTP address, Alias, Shared mailbox size, License status, Archive status, Hide from address list, Audit enabled, Forwarding address, Forwarding SMTP address, Litigation hold status, Retention hold status.

get shared mailboxes in Office 365 using PowerShell

Script Execution Methods:

To run this script, you can choose any of the methods below.

Method 1: To run the script with an MFA and non-MFA accounts,

The exported report will contain all the shared mailboxes in Office 365 and their properties to CSV file.

Method 2: To schedule the script using the non-MFA account,

If the admin account has MFA, you must disable MFA using the Conditional Access policy to make the script work.

Method 3: To find shared mailboxes with licenses, execute the script with the –LicensedOnly switch parameter.

You can download our dedicated script on licensed shared mailbox report to get more detailed shared mailboxes with licenses.

Method 4: To identify shared mailboxes with auto-email forwarding configurations, run the script with –EmailForwardingEnabled switch param.

How to Get Shared Mailbox Members and Permissions:

To get shared mailbox members and shared mailbox Send As/Send On Behalf permissions, you can generate the shared mailbox permission report.

Sample Output:

Shared Mailbox Permission Report

How to Get Shared Mailbox Size in Microsoft 365:

To apply archive and deletion policies or to assign licenses to mailboxes that are nearing full capacity, you can generate the shared mailbox size report.

Sample Output:

How to get shared mailbox size report

Streamline Shared Mailbox Management Efforts with AdminDroid:

keeping track of shared mailboxes and their usage can be a challenging task for IT admins. This is where AdminDroid Office 365 reporting and auditing tool comes in. AdminDroid provides wide range of shared mailbox reports to manage them efficiently.

Shared mailbox reports are categorized based on

  • Shared mailbox info report – Lists all shared mailbox and their details
  • Shared mailbox permission reports – Provides reports on shared mailbox members, delegates, and permission details
  • Shared mailbox email configurations – Shows shared mailbox with inbox rules, forwarding configurations, external forwarding, etc.
  • Shared mailbox hold reports – Describes about shared mailboxes’ hold details, such as litigation hold, in-place hold, and retention hold.
  • Shared mailbox size report – Displays mailbox used size, used percentage, Item count, etc.
  • Shared mailbox email report – Lists all emails that are sent from shared mailbox and who sent the email to whom.
  • Shared mailbox email analytics report – This category provides reports on sent and received emails count by hour of the day & day by the week, email traffic reports on shared mailboxes’ peak/slack hours & days, shared mailboxes’ active and inactive analysis report based on email activity, etc.

Along with these reports, AdminDroid provides 600+ mailbox and email activity reports to monitor mailbox usage, track email traffic, and ensure compliance with organizational policies and regulations.

Shared mailbox report by AdminDroid Exchange Online reporting tool

Shared mailbox email statistics report

AdminDroid Exchange Reporter reduces Microsoft 365 mailbox management challenges and improves your organization’s security. That’s why admins choose AdminDroid for their Exchange Online reporting needs. Here are some key benefits of AdminDroid:

  • Schedules and sends reports to email
  • Exports data in various formats, such as CSV, HTML, PDF, etc.
  • Filters data to generate fine-grained reports
  • Visualizes report data to charts/AI generated graphs
  • Manages multiple tenants
  • User friendly UI
  • Sends instant alert on critical activities like non-owner mailbox access, creation of external forwarding rule, etc.
  • User, groups, license, passwords and other 120+ reports available in Free Edition itself.

Additionally, AdminDroid offers 1800+ pre-built reports and 30+ Office 365 dashboards on various Microsoft 365 services, such as Azure AD, SharePoint, Teams, OneDrive, Stream, etc. Effortlessly manage your Microsoft 365 environment with extensive set of reports and dashboards. From reporting and auditing to alerting, AdminDroid offers comprehensive solution. Download AdminDroid Microsoft 365 reporter to discover how it can benefit your organization.

I hope this blog will you get reports on shared mailboxes. Furthermore, you can opt for Microsoft365DSC to automate, export, and monitor shared mailbox configurations effectively.
If you have any queries or need enhancements to the script, you can reach us through the comment section.

Share article