Exchange administrators should know the maximum possible mailbox size in the environment they are managing, whether on-prem or in the cloud. In an on-prem installation, admins can use this information to prevent excessive database growth. In the cloud, excessive mailbox sizes might require an upgrade of the M365 plan. The configuration of the mailbox quota is possible both in the Exchange admin center (EAC) and via Exchange PowerShell.

Exchange 2016/2019

By default, some quotas are already set in Exchange, which should apply to all users. You can find them in the Exchange admin center under Servers > Databases in the properties of the respective database under Limits.

Overview of the default limits of an Exchange database

Overview of the default limits of an Exchange database

Here, you can see that each mailbox is allowed to be 2.3 GB by default. These thresholds are of great importance because an admin can use them and the number of mailboxes contained in the database to calculate its expected growth.

With Exchange PowerShell, these values can be extracted as follows:

Get-MailboxDatabase -Identity DB01 | Format-List *quota
View the configured quota for an Exchange database using PowerShell

View the configured quota for an Exchange database using PowerShell

However, not all organizations use these thresholds. Any of them can be set to unlimited, allowing a mailbox to grow at will. This makes managing an Exchange Server quite difficult, as database size also grows indefinitely. This also affects, for example, the duration of backups.

You can change these maximum values with PowerShell as follows:

Set-MailboxDatabase -Identity DB01 -IssueWarningQuota 19GB `
-ProhibitSendQuota 19.5GB -ProhibitSendReceiveQuota 20GB

These quotas can also be modified for individual mailboxes. In EAC for each respective user, go to mailbox usage > Customize the quota settings for this mailbox.

Set the maximum allowed size for a specific mailbox in the EAC

Set the maximum allowed size for a specific mailbox in the EAC

Here, it is also possible to increase the quota to unlimited and let the mailbox grow indefinitely.

These settings can also be retrieved using Exchange PowerShell, as follows:

Get-Mailbox -Identity ernie.meier |
Format-List UseDatabaseQuotaDefaults, IssueWarningQuota, `
ProhibitSendQuota, ProhibitSendReceiveQuota
Display the current quota for a user; the first command shows that the user obtains the default values of the DB

Display the current quota for a user; the first command shows that the user obtains the default values of the DB

If UseDatabaseQuotaDefaults is True, the settings are pulled from the database. If the value is False, then these parameters have been customized specifically for this user.

If you want to change these settings, you can do so with the following PowerShell command:

Set-Mailbox -Identity ernie.meier -IssueWarningQuota 30GB -ProhibitSendQuota 40GB `
-ProhibitSendReceiveQuota 50GB -UseDatabaseQuotaDefaults $false

If the quotas were previously too large or too small, the administrator should ascertain the current mailbox sizes to get an idea of the users' actual requirements:

Get-Mailbox -Database DB01 | Get-MailboxStatistics |
Format-Table displayname, totaldeleteditemsize, totalitemsize
Generate statistics for a database's mailboxes

Generate statistics for a database's mailboxes

If you want to analyze the data in Excel or another tool, you can output the information on all mailboxes to a CSV file as follows:

Get-Mailbox -Filter {recipienttypedetails -eq "UserMailbox"} |
Select-Object alias |
Foreach-Object {Get-MailboxStatistics -Identity $_.alias |
Select-Object DisplayName, Database, `
@{Name="Mailboxsize";expression={$_.TotalItemSize.Value.ToMB()}}} |
Export-csv C:\temp\BenuterpostfaecherGroesse.csv

Exchange Online

In Exchange Online, quotas behave somewhat differently from on-prem. The administrator does not have to pay attention to any databases or storage space here.

The quotas there depend on the respective license; most mailboxes are 50 GB but can easily grow up to 100 GB. Unlike a local Exchange, no quotas can be set for individual user mailboxes; the value is the same for all users.

If a user needs more space, then a larger license must be purchased, for example, an upgrade from E3 to E5. The administrator, therefore, no longer has to monitor and maintain quotas.

Nevertheless, there are some commands in PowerShell for Exchange Online that can be used to keep track of mailbox sizes. The following command shows the size of all mailboxes and the number of items they contain:

Get-ExoMailbox | Get-ExoMailboxStatistics |
select DisplayName, ItemCount, TotalItemSize | Sort-Object
Display the size and number of items of all mailboxes on Exchange Online with PowerShell

Display the size and number of items of all mailboxes on Exchange Online with PowerShell

If you have a license (plan) that only allows mailbox sizes up to 50 GB, then you can verify this as follows:

Get-EXOMailbox | Get-EXOMailboxStatistics |
Where-Object {[int64]($PSItem.TotalItemSize.Value -replace '.+\(|bytes\)') -gt "50GB"} |
Sort-Object TotalItemSize -Descending
Select-Object DisplayName, ItemCount, TotalItemSize

Of course, the quotas for specific users can also be displayed as follows:

Get-EXOMailbox roland.eich -PropertySets Quota
Extract all limits for a specific mailbox in Exchange Online

Extract all limits for a specific mailbox in Exchange Online

Conclusion

There is a clear overall difference between self-hosted Exchange and Exchange Online. With a local installation, the admin has to keep an eye on the size of the mailboxes and databases. Microsoft provides the means to display current values and change settings.

Subscribe to 4sysops newsletter!

With Exchange Online, these tasks are not required, and the administrator's activities are shifted to other areas. Nevertheless, by using PowerShell, you can also track the current resource consumption here.

avatar
2 Comments
  1. Good post. In M365, there are also alerts that can be configured to be sent when mailboxes reach the size limit.

  2. I just love the way PowerShell is making administration easy for admins. Thank you for sharing these useful PS commands for managing exchange quotas.

Leave a reply

Your email address will not be published. Required fields are marked *

*

© 4sysops 2006 - 2023

CONTACT US

Please ask IT administration questions in the forums. Any other messages are welcome.

Sending

Log in with your credentials

or    

Forgot your details?

Create Account