There is the odd occasion that you may need to change the allowed message size limits in exchange, either to send or to receive – below we look specifically at self hosted Exchange 2016
First, open up Exchange powershell, and and enter any required domain credentials.
Next we are going to view the current message limits on the server by the following multiline command:
get-transportconfig | ft maxsendsize, maxreceivesize
get-receiveconnector | ft name, maxmessagesize
get-sendconnector | ft name, maxmessagesize
get-mailbox Administrator |ft Name, Maxsendsize, maxreceivesize
Once armed with this information we can proceed to string together a command in order to get the desired messages allowed through the system. The main command is the below:
get-transportconfig | Set-TransportConfig
This calls the transport layer configurations and allows you to pipe changes to it. Next we have the different set commands for different limits;
-maxsendsize 30MB -maxreceivesize 30MB; get-receiveconnector | set-receiveconnector -maxmessagesize 30MB; get-sendconnector | set-sendconnector -maxmessagesize 30MB; get-mailbox | Set-Mailbox -Maxsendsize 30MB -maxreceivesize 30MB
From the above, you can pick and choose what you need to change the message size limits, as in the example, this will set ALL connectors ingoing and outgoing to 30MB. The full command will look something like the below:
get-transportconfig | Set-TransportConfig -maxsendsize 30MB -maxreceivesize 30MB; get-receiveconnector | set-receiveconnector -maxmessagesize 30MB; get-sendconnector | set-sendconnector -maxmessagesize 30MB; get-mailbox | Set-Mailbox -Maxsendsize 30MB -maxreceivesize 30MB