The video shows how to check and set email size limit and attachment size limit in Exchange Online, Exchange 2019, Exchange 2016, Exchange 2013 and Exchange 2010 using PowerShell. Below, you can find all cmdlets used in the video:
The following cmdlets check email size limit on three levels mentioned in the video:
get-transportconfig | ft maxsendsize, maxreceivesize
get-receiveconnector | ft name, maxmessagesize
get-sendconnector | ft name, maxmessagesize
get-mailbox Administrator |ft Name, Maxsendsize, maxreceivesize
In Office 365, replace get-receiveconnector & get-sendconnector to get-inboundconnector & get-outboundconnector.
This set of cmdlets changes Administrator's email size limit to 5 MB, and shows if the changes have been applied:
Get-Mailbox Administrator | Set-Mailbox -MaxSendSize 5MB
Get-Mailbox Administrator | FT Name, MaxSendSize
Get-Mailbox and Set-Mailbox cmdlets are targeted for the Administrator mailbox. You can change Administrator to any other user mailbox.
The cmdlet below creates a mail flow rule which blocks attachments over 3 MB:
New-TransportRule -Name "Block large attachments" -AttachmentSizeOver 3MB -RejectMessageReasonText "Message attachment exceeded 3 MB. This email will not be delivered."