Migration Conundrums – Quotas and Mailbox Arrangement

Performing an Exchange Migration requires a lot of pre-planning and even some research before any work is done. Two often overlooked items are how to sort the mailboxes into the new Exchange Server databases as well as mailbox quotas. How will the mailboxes be arranged – by size, name, random, department, etc.? For Quotas will they remain the same or will mailboxes be allowed to grow? This article attempts to go through some logical processes to help the engineer performing the migration with these items in mind.

Sorting Mailboxes
Depending on the size of your environment this may be a quite a task. Another factor is the number of factors used to determine placement – title/level, mailbox size, alphabetical, department, etc.

I pose this question to my clients prior to finishing the Exchange design – “How would you like the mailboxes sorted in the new databases?” The typical answer is alphabetical. No more complicated than that. The rare client is one that uses departments which led to one client with < 300 users to have 23 databases. Sometimes the reaction is like a deer in headlights – no idea and had not even thought it was important enough for a design question.

My recommendation for mailbox sorting is to place mailboxes in random databases with an eye on size of the overall databases.

Why? My goal is to prevent any one failure from causing an entire department or an entire level of management from being affected.

  • Executives/Upper Management in one database – if that database is corrupt, your entire leadership team could be down. That’s also a lot of important, VIP treatment that will be needed from IT support if all are down at once. Better to scatter these users into multiple databases to reduce exposure for your high maintenance users.

  • Alphabetical – Seems like a wonderful idea, but how do you split up the alphabet?


    Arranging mailboxes in this manner could lead to an uneven distribution of mailboxes in Q-T. This distribution could then lend to uneven databasesizes which would then makes for a disproportional support problem down the road with backups, restores or repairs/corruption issues. For example Q-T could be 300 GB while A-D could be 50 GB.

  • Size – How would this be accomplished? Larger mailboxes in one database, medium in another,

  • Department – Depending on the size of your organization, this could lead to a large amount of databases. The downside to this arrangement is if a database goes down it could potentially paralyze an entire department like IT, Legal, Sales or Marketing. From a managing perspective finding the location of a mailbox would be easier, however no other benefit would be derived from the arrangement.

  • Random (PREFERRED) – The name says it all. Placing mailboxes in databases in such a way that no single department, management level, etc will be affected by a single database failure. The only caveat to random is keeping an eye on database size so that the databases stay as even as possible for easier maintenance down the road.



    Migratng to new mail systems usually require an organization to examine their mailbox quotas. With Exchange Server 2013 quotas can be applied to database or mailboxes. There are no mailbox policies that can be applied to groups of users.

    What is the best way to apply these quotas to users?

    The answer, as it seems to be with most tasks with Exchange Server 2013, is PowerShell. My method does require setting an attribute on users used to determine which quota to apply, but this can also be accomplished with PowerShell. Let’s start with a sample scenario:

    1000 Users in a manufacturing company.

    Quotas are needed with the following goals in mind:

    • Executives (C Level) – Level 1 Quota – 10 GB for Warning, Unlimited for Prohibit Send and Unlimited for Prohibit Send and Receive
    • Senior Management – Level 2 Quota – 5 GB for Warning, Unlimited for Prohibit Send and Unlimited for Prohibit Send and Receive
    • Everyone else – Level 3 Quota – 1.6 GB for Warning, 1.8 GB for Prohibit Send and 2 GB for Prohibit Send and Receive

    A per database policy can not be applied if mailboxes are sorted randomly, as would be the case if the mailboxes are sorted by size or department. A quicker more efficient/automated way is needed for Exchange Administrators/Engineers. My solution for this is to tag an attribute in AD on the user/mailbox object that can be read by PowerShell to determine the quota level a mailbox will get. For this exercise, the attribute used is CustomAttribute10. For this attribute “E” will be for Executives, “M” for management and blank or null will be used for all other mailboxes. In order to set these values we need a CSV file that has the users alias or SAM Account name and for our example, the file will be called executives.csv for the Executives and management.csv for Management. Here is the script:

    $users = import-csv c:\temp\executives.csv
    foreach ($line in $users) {
    	get-mailbox $line | set-mailbox -CustomAttribute10 "E"
    $users = import-csv c:\temp\management.csv
    foreach ($line in $users) {
    	get-mailbox $line | set-mailbox -CustomAttribute10 "M"

    Attributes can be verified by running a quick one liner

    get-mailbox |ft displayname,customattribute10 -auto

    After the attribute has been set, quotas can now be configured per user using PowerShell. The below script will set quotas for Executives, Management and all other users:

    # This script reads the 'CustomAttribute10' attribute on a users mailbox.
    # The script then configures the Quotas based on that attribute.
    # By: Damian Scoles, 2014
    #    This script should be scheduled to run daily.
    $mailboxes = get-mailbox
    foreach ($line in $mailboxes){
    	$user = $line.displayname
    	$attribute = (get-mailbox $user).CustomAttribute10
    	if ($attribute -eq "E") {
    		# This sets the quota for Executives to warn at 10 GB.
    		 Get-Mailbox $user | set-mailbox -UseDatabaseQuotaDefaults $false -IssueWarningQuota 10GB -ProhibitSendQuota unlimited -ProhibitSendReceiveQuota unlimited
    	if ($attribute -eq "M") {
    		# This sets the quota for Senior Management to warn at 5 GB.
    		 Get-Mailbox $user | set-mailbox -UseDatabaseQuotaDefaults $false -IssueWarningQuota 5GB -ProhibitSendQuota unlimited -ProhibitSendReceiveQuota unlimited
    	if ($attribute -eq $null) {
    		# This sets the quota for Executives to warn at 1.6 GB, prevent sending at 1.8GB and prohibit send and receive at 2.0 GB.
    		 Get-Mailbox $user | set-mailbox -UseDatabaseQuotaDefaults $false -IssueWarningQuota 1.6GB -ProhibitSendQuota 1.8GB -ProhibitSendReceiveQuota 2.0GB

    Attributes can be verified by running a quick one liner

    get-mailbox |ft UseDatabaseQuotaDefaults,IssueWarningQuota,ProhibitSendQuota,ProhibitSendReceiveQuota -auto

    Of course this can be made more complex with as many levels of quotas as an organization needs to apply. Other custom attributes can be used to call on for the script as well or the use of more common attributes like department names and even OUs can be used for these scripts. Modify this to suit your needs.


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 )

Google+ photo

You are commenting using your Google+ 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