Set Exchange Online Mailbox Sizes and Limits with PowerShell

By September 14, 2020October 7th, 2020Blog, Exchange, Microsoft
Microsoft Exchange

Need to change the default Exchange Online mailbox size limits for a single or multiple users? Follow the steps below for quick set-up:

How to set mailbox size limits for a single user

  1. Connect to Exchange Online by using remote PowerShell using the commands below:
  • $UserCredential = Get-Credential
  • $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/- Credential $UserCredential -AuthenticationBasic -AllowRedirection
  • Import-PSSession $Session -DisableNameChecking
Note: For additional information about getting connected to Exchange Online, go to the following Microsoft website: Connect to Exchange Online Using Remote PowerShell.
Microsoft Exchange
  1. Run the following PowerShell command to set the mailbox size for a single user:
  • Set-Mailbox -ProhibitSendQuota -ProhibitSendReceiveQuota -IssueWarningQuota
Microsoft Exchange
  1. The placeholder represents a mailbox user’s UPN, email address, or GUID, and the placeholder represents a number in megabytes (MB), kilobytes (KB), or gigabytes (GB). For example, to set a mailbox size to 20 GB, to set the send limit at 19 GB, and to issue a warning at 18 GB, run the following command:
  • Set-Mailbox pei@pei.com -ProhibitSendQuota 19GB -ProhibitSendReceiveQuota 20GB -IssueWarningQuota 18GB
Microsoft Exchange
  1. Run the following command to check that the current list of quotas is attached to the mailbox:
  • Get-Mailbox | Select *quota

How to set mailbox size limits for multiple users

  1. Using the commands below, connect to Exchange Online by using remote PowerShell:
  • $UserCredential = Get-Credential
  • $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection
  • Import-PSSession $Session -DisableNameChecking
  1. Run the following PowerShell command to set the mailbox size for all the users in an organization:
  • Get-Mailbox | Set-Mailbox -ProhibitSendQuota <Value> -ProhibitSendReceiveQuota <Value> -IssueWarningQuota <Value>
  1. Additional filters can be applied to the Get-Mailbox cmdlet or to the Get-User cmdlet to control the users for whom the change is applied. The following is an example in which three cmdlets are used to filter the command to the sales department of an organization:
  • Get-User | where {$_.Department -eq “PEI IT”} | Get-Mailbox | Set-Mailbox -ProhibitSendQuota <Value> -ProhibitSendReceiveQuota <Value> -IssueWarningQuota <Value>

Brandon | PEI

Leave a Reply