Share via

PowerShell script for alerting when an EXO mailbox reaches 90%

Irfan Khan 180 Reputation points
2026-03-31T17:19:17.4666667+00:00

I am trying to explore for a scripting option since there is no built-in alerting system in Microsoft 365 to send an alert email to global admins when an Exchange online mailbox reaches the mailbox size reaches 90%.

Exchange Online
Exchange Online

A cloud-based service included in Microsoft 365, delivering scalable messaging and collaboration features with simplified management and automatic updates.


Answer accepted by question author

Teddie-D 16,885 Reputation points Microsoft External Staff Moderator
2026-03-31T23:24:33.25+00:00

Hi @Irfan Khan

Thank you for posting your question in the Microsoft Q&A forum. 

From my findings, this script may meet your requirement. It’s a PowerShell script that monitors mailbox usage in an Exchange environment, flagging mailboxes that exceed 70% of their quota or use more than 40 GB of space. The script generates an HTML report and sends an email notification if any mailboxes meet these criteria. You’ll need to adjust it to fit your specific environment. 

You may find this helpful: GitHub

If you prefer alternatives to PowerShell, there are other approaches discussed in this thread: How to setup an email storage alerts to get admins notified when each individual users mailbox reac… 

I hope this helps.


Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.   

Was this answer helpful?


1 additional answer

Sort by: Most helpful
  1. AI answer

    2026-03-31T17:19:34.5033333+00:00

    Exchange Online already surfaces mailbox-capacity issues through built-in monitoring and reporting; a custom 90% alert script would typically be layered on top of those signals.

    For proactive monitoring, use the existing service advisory and reporting features, then drive any custom alerting from that data source (for example, via scheduled jobs or external monitoring tooling):

    1. Monitor Exchange Online service advisories for mailbox utilization
      • In the Microsoft 365 admin center, go to HealthService healthExchange Online.
      • Under Organization scenarios, look for Mailbox Storage Limits, or use the Active issues tab.
      • When a mailbox utilization advisory is raised, it includes a link under User impact that opens a flyout listing affected mailbox GUIDs (up to 155 mailboxes). These are mailboxes that are on hold and at risk of reaching or exceeding their quota.
      • Use this list as the authoritative set of “at-risk” mailboxes that need admin attention.
    2. Use the mailbox usage report for broader coverage
      • If more than 155 mailboxes are nearing quota, use the mailbox usage report in the admin portal (Mailbox usage report URL is provided in the context) to see utilization across all mailboxes.
      • This report can be used as the data source for a scheduled script (for example, export the report and process it externally) to identify mailboxes above a chosen threshold such as 90%.
    3. Understand quota thresholds and what “90%” means
      • Exchange Online capacity alerts are based on three quota points: Warning, Prohibit Send, and Prohibit Send/Receive.
      • Default values depend on the license. For example, for Exchange Online Plan 1 / Microsoft 365 Business Basic/Standard:
        • Warning: 49 GB
        • Prohibit Send: 49.5 GB
        • Prohibit Send/Receive: 50 GB
      • For Exchange Online Plan 2 / Microsoft 365 E3/E5:
        • Warning: 98 GB
        • Prohibit Send: 99 GB
        • Prohibit Send/Receive: 100 GB
      • A “90%” threshold in a script should be calculated relative to the mailbox’s configured quotas (for example, 90% of ProhibitSendReceiveQuota), not a hard-coded GB value, because quotas vary by license and can be customized.
    4. Customize quotas where appropriate
      • If certain users or departments frequently approach quota, adjust their mailbox quotas (within plan limits) rather than only alerting.
      • For example, to set custom quotas for a filtered set of users:
             Get-User | where {$_.Department -eq "Sales"} | Get-Mailbox |
               Set-Mailbox -ProhibitSendQuota <Value> -ProhibitSendReceiveQuota <Value> -IssueWarningQuota <Value>
        
      • This allows aligning the built-in warning/prohibit thresholds with organizational needs, which can reduce the need for a separate 90% alert.
    5. Script design considerations (high level)
      • A typical custom alerting solution would:
        • Enumerate mailboxes and read their quota properties (for example, IssueWarningQuota, ProhibitSendQuota, ProhibitSendReceiveQuota).
        • Compare current mailbox size (for example, via mailbox statistics) to a calculated 90% of the relevant quota.
        • Send an email to global admins when a mailbox crosses that threshold.
      • When implementing, align the script’s logic with the documented capacity alert thresholds so that custom alerts complement, rather than conflict with, the built-in warning/prohibit behavior.
    6. Use service advisories as an operational safety net
      • Even with a custom 90% script, continue to rely on the Exchange Online service advisories for:
        • Visibility into mailboxes on hold that are at or near quota.
        • A quick way to identify and remediate the most critical cases.
      • Note that mailbox usage report data can lag the service advisory by up to 24 hours, so treat advisories as the more time-sensitive signal.

    References:

    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.