This article includes commands to get or change the default send/receive limits in Exchange Online
Prerequisites
These scripts require the ExchangeOnlineManagement module.
Commands
Get the Current Limits
Get-MailboxPlan | fl name,maxsendsize,maxreceivesize,isdefault
Change the default limits
From the above command, find the one set as default, and copy the name into the below command:
Set-MailboxPlan <Plan Name> -MaxSendSize 150MB -MaxReceiveSize 150MB
Note: 150MB is the current limit
Change the Limit for all Plans
(Get-MailboxPlan).name | forEach{Set-MailboxPlan $_ -MaxSendSize 150MB -MaxReceiveSize 150MB}
Get the limit for a specific mailbox
Get-Mailbox "[email protected]" | fl mailboxplan,maxsendsize,maxreceivesize
Change the limit for a specific mailbox
Set-Mailbox "[email protected]" -MaxReceiveSize 150MB -MaxSendSize 150MB
Change the limit for all mailboxes
Get-Mailbox -Resultsize Unlimited | Set-Mailbox -MaxReceiveSize 150MB -MaxSendSize 150MB
Get send/receive limits and current mailbox size for all users
$AllUsers = Get-Mailbox -ResultSize unlimited
$UserDetails = @()
$Counter = 0
$UserDetails = ForEach($user in $allusers) {
$Counter++
Write-Progress -Activity 'Processing details' -CurrentOperation $user -PercentComplete (($counter / $allusers.count) * 100)
$UPN = $User.UserPrincipalName
$Properties = [ordered]@{
Name = $User.Name
UserPrincipalName = $User.UserPrincipalName
IssueWarningQuota = $User.IssueWarningQuota
ProhibitSendQuota = $User.ProhibitSendQuota
ProhibitSendReceiveQuota = $User.ProhibitSendReceiveQuota
ArchiveWarningQuota = $User.ArchiveWarningQuota
ArchiveQuota = $User.ArchiveQuota
TotalItemSize = Get-MailboxStatistics -Identity "$UPN" | Select TotalItemSize
}
New-Object -TypeName PSObject -Property $Properties
}
$UserDetails | Export-CSV "Client.csv"