Petri Newsletter Sign-up
Tech Tuesday

Subscribe to Tech Tuesday, the latest insights from Petri.com for IT Pros.

    See All Petri Newsletters

    Managing Exchange Online Mailbox Size Limits with PowerShell

    Posted on by J. Peter Bruzzese in Exchange Server

    An important part of managing any Microsoft Exchange deployment, whether on-premises or online, is the appropriate allocation of storage space. An important task related to that is monitoring and limiting the size of user mailboxes. Thankfully, you’ll find that these tasks in Exchange Online are easily done with a just few simple PowerShell commands. In this article I’ll walk you through managing Exchange Online mailbox size limits with a handful of useful Windows PowerShell cmdlets.

     

    Managing Exchange Online Mailbox Size Limits with PowerShell

    PowerShell can be a useful tool to help you manage Exchange Online Mailbox Size Limits.
    (Image: Jeff James)

    Setting Mailbox Size Limits for a Single User

    1. Let’s start with setting limits. We can do this for one user at a time or groups of users. First the command for changing the size limit for a single user using the following PowerShell command:


    2. Here is the command we would use if we wanted to limit Robert Williams’ mailbox to a size of 24 GB with a warning at 20 GB and a limit on sending messages at 22 GB:

    Setting Mailbox Size Limits for Multiple Users

    1. To make the same change for multiple users we will add the Get-User cmdlet along with a filter. If we wanted to set a specific quota for the Customer Service department we might use a command like this:


    2. To apply a size limit for your entire organization simply use a command with this syntax:


    Reporting Exchange Online Mailbox Storage Statistics

    Now that you know how to quickly change size limits and quotas for users in Exchange Online, let’s learn how to use the Get-MailboxStatistics cmdlet to gather information about mailbox storage. To start off we will take a look at the quota we just assigned to Robert Williams as well as the total size of all mailbox items:


    We do not need to limit ourselves to single users. You can also use Get-MailboxStatistics to review the usage statistics for your entire organization:


    You can refine your results by looking only for those mailboxes that are not below their limit:

    Export Mailbox Size Data to Excel

    You can even export your results to a Microsoft Excel .CSV file with the following PowerShell cmdlet:


    Managing mailbox size limits and quotas is an essential part of any Exchange administrator’s job, but when you learn how to use PowerShell with Exchange Online it does not have to be a tedious time-waster. Now you can quickly finish simple tasks — such as assigning limits and gathering data on organization-wide Exchange Online usage — with only a few simple PowerShell cmdlets.

    To see additional PowerShell resources for managing Microsoft Exchange Online, check out the following:

    BECOME A PETRI MEMBER:

    Don't have a login but want to join the conversation? Sign up for a Petri Account

    Register

    Register for this Petri Webinar!

    Software-Defined Unlimited Backup Storage

    Tuesday, August 27, 2019 @ 1:00 pm EDT

    A Scale-Out Backup storage infrastructure is a must-have technology for your backups. In this webinar, join expert Rick Vanover for a look on what real-world problems are solved by the Scale-Out Backup Repository.

    Register Now

    Sponsored By