PS Exchange – Setting up quotas

To check quotas on a DB:

Get-MailboxDatabase -Identity DB | Format-List *Quota

ProhibitSendReceiveQuota     : unlimited
ProhibitSendQuota            : 1000 MB (1,048,576,000 bytes)
RecoverableItemsQuota        : 30 GB (32,212,254,720 bytes)
RecoverableItemsWarningQuota : 20 GB (21,474,836,480 bytes)
IssueWarningQuota            : 900 MB (943,718,400 bytes)

To Set

$databaseQuota = @{
    'Identity' = "DB"
    'IssueWarningQuota = '2GB'
    'ProhibitSendQuota' = '10GB'
}
Set-MailboxDatabase @databaseQuota

To set user quotas

Get-mailbox -id $mailbox | fl *quota,UseDatabaseQuotaDefaults

If the userDatabaseQuotaDefaults is set to $true then DB values apply
To set user quota:

$userQuota = @{
    'Identity' = $Mailbox
    'IssueWarningQuota = '20GB'
    'ProhibitSendQuota' = '22GB'
    'userDatabaseQuotDefaults' = $false
}
Set-mailbox @UserQuota