- Microsoft Graph: A single (PowerShell) API for Microsoft’s cloud services - Tue, Aug 23 2022
- Exchange impersonation: Grant permissions to service accounts - Mon, Aug 8 2022
- Send Microsoft Teams meeting invitations in multiple languages - Thu, Jul 21 2022
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.
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
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.
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
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
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
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
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.
Good post. In M365, there are also alerts that can be configured to be sent when mailboxes reach the size limit.
I just love the way PowerShell is making administration easy for admins. Thank you for sharing these useful PS commands for managing exchange quotas.