The instructions below explain how to change Exchange’s maximum email message size. Microsoft’s best practices recommends having the send and receive connectors configured with the same sizes. In the example below I’m configuring Exchange to allow a max email size of 21MB.
- Let’s start at the top by changing the setting under Organization Configuration, Hub Transport, Global Settings. Then modify the maximum receive and send size. (Image Below)
Powershell version to step 1 is:
To view current settings: Get-TransportConfig |Ft MaxSendSize, MaxReceiveSize
To modify the settings: Get-TransportConfig | Set-TransportConfig -MaxSendSize 21MB -MaxReceiveSize 21MB
- Next is to configure all of your send connectors with 21MB. The connectors reside under the Organization Configuration, Hub Transport, Send Connectors. The image below shows a total of 4 connectors that will be modified.
Powershell version to step 2 is:
To view current settings: Get-SendConnector | ft Name, MaxMessageSize
To modify the settings: Get-SendConnector | Set-SendConnector -MaxmessageSize 21MB
- Your next stop will be the Receive Connectors located at Organization Configuration, Server Configuration, Hub Transport. Make sure to change the settings on all receive connectors you may have.
Powershell version to step 3 is:
To view current settings: Get-ReceiveConnector | ft Name, MaxMessageSize
To modify the settings: Get-ReceiveConnector | Set-ReceiveConnector -MaxmessageSize 21MB
- You may or may not need to configure your employees Message Size Restrictions if you have a policy in place for that. In my case, I don’t have to change any settings because my employees size restrictions are applied from the items listed above.
- The following setting needs to be done on all of your Hub Transports servers. Modify the web.config file to match 21MB settings listed above. The web.config file can be found at c:\Program Files\Microsoft\Exchange Server\ClientAccess\Owa\web.config. The line you’re modify is:
<system.web>
<httpRuntime maxRequestLength=”21504” />
- The “Microsoft Exchange Transport” service needs to be restarted after modifying the web.config file. By restarting the service you force the settings adjusted on step 5. Please note, by restarting this service your Hub Transport will stop routing email until the service has started again. Your employees should not notice the short outage but you’ve been warned.
You can use the PowerShell CMD to restart the service:restart-service -Name “MSExchangeTransport”
- Test the settings configured above by sending an email with an attachment of 21MB to confirm everything is working as planned. Below is a nice command to create a txt file of any size:
fsutil file createnew
Example:
fsutil file createnew c:\20MBfile\20MBfile.txt 20971520
By using PowerShell you can accomplish the same results in less time. If you notice I didn’t give a PowerShell command for step 4 because in my situation I didn’t require it. However, the command to do step 4 is below. BUT USE WITH CAUTION!
This command will set every employee’s setting to 21MB:
Get-MailBox | Set-Mailbox -MaxSendSize 21MB -MaxReceiveSize 21MB
This command will set only the employee you choose:
Get-MailBox | ft Name, MaxSendSize, MaxReceiveSize
Set-MailBox <employees’s email> -MaxSendSize 21MB -MaxReceiveSize 21MB
This command will set the every employee’s setting to unlimited. Note, by setting it to unlimited the employee will be force to comply with the setting configured in steps 1 thru 3.
Get-MailBox | Set-Mailbox -MaxSendSize unlimited -MaxReceiveSize unlimited
AS ALWAYS, TEST EVERY CHANGE BEFORE MODIFYING YOUR PRODUCTION ENVIRONMENT!