February 10, 2024

Export Exchange Online Shared Mailbox Size Report Using PowerShell

by Thiraviam

6 min read

No Comments

Shared mailboxes provide centralized delegated access to common mailboxes and enhance organization-wide coordination without requiring additional licenses. However, it’s crucial to get shared mailbox size reports in Microsoft 365 to tackle potential storage issues.

Tracking shared mailbox usage, including the total size aids in capacity planning and enables organizations to maintain a responsive email environment. This blog highlights the methods to obtain shared mailbox sizes for efficient shared mailbox management. Here, we’ll also introduce a crafted PowerShell script that simplifies the process of exporting shared mailbox size reports.

How to Check Shared Mailbox Size in Microsoft 365?

The size of a Microsoft 365 shared mailbox can be listed by two major methods, they are the Exchange admin center and PowerShell. Here’s a detailed analysis of both approaches:

Find out Shared Mailbox Size Using the Exchange Admin Center

To obtain the storage insights of a shared mailbox using the Exchange admin center, follow these steps:

  1. Log in to the Exchange admin center with the global administrator or Exchange administrator credentials.
  2. In the Exchange dashboard, go to the “Recipients” tab and choose the Mailboxes option.
  3. Select the shared mailbox from the list. Upon selection, the respective shared mailbox details will appear.
  4. In the “General” tab, you can find the shared mailbox usage along with the total storage and the currently consumed percentage.

Get Shared Mailbox Size - Exchange admin center

As there is a need to repeat the same process to check the storage insights for more than one shared mailbox, this approach is not suitable for multiple mailboxes.

Get Shared Mailbox Size Using PowerShell

The Exchange Online PowerShell cmdlets like “Get-MailboxStatistics” and “Get-mailbox” help to list all shared mailboxes along with their storage details. However, retrieving the most needed attributes can be challenging, as these cmdlets provide plenty of details. This can be particularly difficult for admins who are new to PowerShell.

As a solution to this concern, we’ve crafted a PowerShell script that exports shared mailbox size in a more efficient and user-friendly manner.

Script Highlights

  1. The script can be executed with MFA-enabled accounts too.
  2. It exports report results to CSV file format in the working directory.
  3. You can export the mailbox size of all the shared mailboxes.
  4. You can pass an input file to get usage statistics of specific shared mailboxes alone.
  5. The script automatically installs the EXO PowerShell module (if not installed already) upon your confirmation.
  6. The script is scheduler-friendly, allowing credentials to be passed as parameters instead of saving them within the script.
  7. Furthermore, it supports certificate-based authentication (CBA) for enhanced security during the authentication process.

Sample Output:

Get shared mailbox size report - PowerShell Script

How to Execute Shared Mailbox Size Report Script?

First, download the provided PowerShell script. Next, open Windows PowerShell and navigate to the directory where the script is located. After that, execute the script using one of the following methods:

Method 1: You can execute the script with MFA and non-MFA accounts.

Method 2: Execute the script with the explicit credentials (Scheduler-friendly) for an unattended approach.

You can schedule the PowerShell script using the task scheduler with the given code for non-MFA admin accounts. If the admin account utilizes multi-factor authentication, you can disable MFA through the Conditional Access policy for the successful execution of the scheduled script.

Method 3: For certificate-based authentication, execute the script using the following essential parameters.

To run this PowerShell script with the certificate-based credentials, register an app in Azure AD and connect to MS Graph using a certificate. You can use either a certificate issued by CA or create a self-signed SSL certificate that is preferred by many admins in internal scenarios.

Script execution - Shared mailbox size report

Shared Mailbox Size Report – Detailed Execution Methods

As the highlights section conveys, you can obtain shared mailbox size reports for two requirements using this PowerShell script:

  1. Export all shared mailbox sizes to CSV
  2. Check mailbox size for a list of shared mailboxes

Export all Shared Mailbox Size to CSV

Checking the shared mailbox storage aids in capacity planning, ensuring adequate space, and facilitating effective management through archive and deletion policies.

To export the report on the size of all shared mailboxes in your organization, you can execute the PowerShell script as stated here:

Moreover, analyzing the report empowers you to add licenses to shared mailboxes, enhancing storage capacity if the available space is close to full. You can also use the prebuilt PowerShell script to find and remove licenses from shared mailboxes if an unwanted one is assigned.

Overall, the scheduler-friendly capability of this script helps you to determine all shared mailbox sizes during certain intervals, ensuring a responsive email system.

Check Mailbox Size for a List of Shared Mailboxes (Input CSV)

While the above execution exports all the shared mailbox sizes and the statistics, you can export only the report for certain shared mailboxes with the help of a CSV file input. This functionality is particularly beneficial for larger organizations where targeted insights into specific shared mailboxes are crucial.

To get usage statistics of specific shared mailboxes, first create a CSV file with a set of shared mailbox identities such as the name or UPN.

Sample Input:

Check Mailbox Size for a List of Shared Mailboxes (Input CSV)

After that, execute the PowerShell script along with the CSV file path as demonstrated here:

The exported shared mailbox size report not only gives the sizes of all shared mailboxes but also gives the following useful metrics:

Attribute Explanation
Shared mailbox name Name of the shared mailbox.
UPN User Principal Name associated with the shared mailbox.
Primary SMTP address Primary email address used for the shared mailbox.
Item count Total number of emails in the shared mailbox.
Total size Total size of used storage for the shared mailbox.
Total size (bytes) Total size of used storage in bytes.
Archive status Status indicating whether the shared mailbox is archived.
Deleted item count The number of items currently in the deleted items folder.
Deleted item size Total size of items in the deleted items folder.
Issue warning quota Threshold indicating when a warning is issued for shared mailbox size.
Prohibit send quota Limit beyond which sending emails is prohibited.
Prohibit send receive quota Limit beyond which all shared mailbox activities are prohibited (total storage capacity).

The above script provides insights on shared mailbox storage, but if you need additional details, AdminDroid Microsoft 365 Reporter offers a more comprehensive solution. While the script provides a specific set of data, AdminDroid stands out with its intuitive interface and extensive reporting capabilities.

Effortless Shared Mailbox Management with AdminDroid

The Exchange Online reporting tool from AdminDroid offers administrators a range of detailed insights, with a particular spotlight on shared mailbox reports. The key reports for Microsoft 365 shared mailboxes include:

  • All shared mailbox storage insights
  • Shared mailbox membership
  • Shared mailbox size growth
  • Shared mailbox permission details
  • Shared mailboxes with inbox rules
  • Shared mailboxes configured with email forwarding
  • Shared mailboxes with litigation/retention/in-place hold.
  • Shared mailbox peak/slack hours by mail sent/received.
  • Shared mailbox email traffic insights

All shared mailbox report - AdminDroid

The wide-ranging capability of Exchange reports doesn’t end here! Apart from the shared mailbox reports, AdminDroid offers reports on all types of mailbox and email activities to monitor mailbox usage, track email traffic, and ensure resource allocation.

As the crown adds more glory, Exchange Online auditing provides audit reports covering M365 mailbox permission changes, mailbox configuration changes, and threat protection activities. Overall, AdminDroid offers 180+ reports on Exchange Online management and supplies extensive data for a thorough understanding of M365 mailboxes through the Exchange Online dashboard.

Exchange Online Dashboard - AdminDroid

Why do admins prefer to choose AdminDroid?

Most admins prefer AdminDroid – M365 reporting tool for the following compelling reasons:

  • Offers customizable charts and vivid graphs for crystal-clear data understanding.
  • Provides free lifetime access to 120+ Azure AD reports.
  • Gives a 15-day premium version trial with all functionalities like reporting, scheduling, exporting, alerting, and compliance.
  • Overall, the tool offers 1800+ all-inclusive reports and 30+ dashboards on M365 services like MS Teams, Entra ID, SharePoint Online, Viva Engage, Power BI, and more.

Why still thinking? Download AdminDroid today and explore how it makes your Microsoft 365 management easier.

Overall, we hope this blog helps you to get shared mailboxes size and the related statistics with the help of the PowerShell script. Knowledge of shared mailbox sizes assists in preventing potential bottlenecks and addresses storage-related issues, ensuring the maintenance of a well-organized and secure email environment. If you have any queries or need enhancements to the script, you can reach us through the comment section.

Share article