Home > Exchange Solutions > Exchange Mailbox Size via Powershell

Exchange Mailbox Size via Powershell

Exchange 2007 Mailbox Size
Get-MailboxStatistics |where {$_.TotalItemSize -gt 1MB} | sort $_.TotalItemSize |FT DisplayName,ItemCount,TotalItemSize >c:\size.txt

To determine globally what size limits are for Transport:
Get-TransportConfig | FL *size
[PS] C:\> Get-TransportConfig | FL *size
MaxReceiveSize : 20MB
MaxSendSize : 50MB

To set the Transport size limits – for example to 1000MB:
Set-TransportConfig -maxsendsize 1000MB

To set Receive size settings:
Set-TransportConfig -maxreceivesize 1000MB
The connector by default has 10MB limit; Exchange Org level and Mailbox Level settings default to “unlimited”

Get-SendConnector |FL name, *size – shows the maxSendSize on SendConnector

To Set SendConnector size: Set-SendConnector -maxmessagesize 100MB

**********************
Below is some info I found while troubleshooting an Exchange OWA size issue.

OWA Attachment limits – yes there are limits to the size of attachments you can add via OWA… But these are changeable too!
By default the limit in Exchange 2007 OWA is 30MB. Depending on what your company needs, you might want to increase or decrease this size.
To do so, follow these steps:
1. You need to set the MaxRequestLength in web.config to a value larger than 50 MB. The MaxRequestLength in web.config is an ASP.NET setting that prevents requests larger than a certain length which was added to prevent DOS attacks. It is set to 30 MB by default and needs to be increased in order to send attachments larger than 30 MB. This could also be decreased to enforce a lower limit.

2. You need to increase the MaxSubmitMessageSize which is a readonly Mailbox property (MaxSubmitMessageSize = 0x666D0003) and this is where we are getting the 10 MB limit from.

This is read from the following places:

First read from Mailbox object of the user itself
if not found as denoted by “unlimited”, Transport Settings Container
if not found as denoted by “unlimited”, from Org Container (default read from Org Container)
In order to set the value, use the following tasks in the Exchange Management Shell:

1. set-transportconfig and then set MaxSendSize (this is in KBs) to 51200 for 50 MB attachments. This will set it for all users
Or
2. set-mailbox and set the MaxSendSize (this is in KBs) to 51200 for 50 MB attachments for a specific set of users.

Once you set either, you need to recycle store or not access the mailbox for about 15-20 minutes (to let store cache expire) in order for the size change to have affect. Also, the property is stored in AD and subject to replication delays.

One more thing that you need to be aware of (sorry, the list just goes on):

We have a Request timeout of 60 minutes for any attachment upload request or attachment download (in OWA Basic and Premium). So, if you are trying to upload a 50MB attachment over a 56Kbps link, you will time out and get a HttpWebException (e.g., the max upload is about 25 MB over a 56 Kbps link).

So, to summarize, there are two keys to send a large attachment:

1. Modify ASP.NET web.config settings.

2. Modify the MaxSendSize using either the set-TransportConfig (for all users) or Set-Mailbox for individual users.

And you need to

3. Make sure the total upload time will be less than 60 minutes (based on your size and the speed of your network link)

The web.config change is immediate but the MaxSendSize change takes time, due to caching policy (Mailbox cache, DSAccess delays, and replication delays).

Examples:

Web.Config change

By default, web.config under OWA Vdir (Microsoft\Exchange Server\ClientAccess\Owa) will have the following entry (by default, the max request size is approximately 30MB):

….

Change to where X is the desired value in KBs. So, for 50MB, X will be approximately 50000.

Change per-user message size limit

Go to Exchange Management Shell, and type the following command:

Set-mailbox -id:”username” -MaxSendSize:50000

Where “username” is the mailbox identity. This will set the maximum message send limit to approximately 50 MB. You will need to restart store to see the effect immediately.

Change all-user message size limit
Go to Exchange Management Shell, and type the following command:
Set-transportconfig -MaxSendSize: 50000

This will set the maximum message send limit to approximately 50 MB. You will need to restart store to see the effect immediately.

Categories: Exchange Solutions
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: