Quick Steps:

  • Copy all the aliases to a text file
  • If you have multiple forests, run $AdminSessionADSettings.ViewEntireForest = $true
  • Use the following command to change the limits.

Get-content input.txt | get-mailbox | set-mailbox -IssueWarningQuota 450MB -ProhibitSendQuota 500MB -ProhibitSendReceiveQuota 1GB -usedatabasequotadefaults:$false

Some details below:

To get current mailbox limits for multiple users, populate users.txt file and run the following command.

get-content users.txt |get-mailbox |ft alias,issuewarningquota,prohibitsend*,usedatabasequotadefaults –autosize

For setting quota for single user:

Set-mailbox alias –prohibitsendreceivequota #

Set-mailbox alias –prohibitsendquota #

Set-mailbox alias –issuewarning quota #

For multiple users:

get-content users.txt |Set-mailbox -prohibitsendreceivequota #

get-content users.txt |Set-mailbox -prohibitsendquota #

get-content users.txt |Set-mailbox -issuewarningquota #

Command to remove database quota defaults:

get-content users.txt | set-mailbox -usedatabasequotadefaults:$false

To find the default limits for every server in a forest.

Get-MailboxDatabase |ft storagegroup,prohibitsend*

— Thanks, Jinesh.