Limiting Active Mail Count with Message Records Management

Overview:

Currently in the process of migrating between Exchange 2010 archiving solutions. As part of this process we have decided to journal all messages as well.

However we have other factors to consider;

  • Mailbox Sizes, and their causes
  • No retention times on length of time mail stored
  • We already have in place mailbox size restrictions that allow us to have a “per user exchange cost” on the disk side, however we have ran into a problem where the stubs created by our old archiving solution (Enterprise Vault) use up a certain amount of space, so those users who have been around for many years end up loosing a huge portion of their allotted space just to those stubs.
  • The new archiving solution has limited disk space.
Side Note, we could have purchased a larger box that had more disk space, but the cost was ludicrous for something we truly didn’t need, at least at this point.

Decisions:

The question then began how do we free up the space created by those stubs? Do we need those stubs? How does it affect the client? Turns out we decided that our new product has a built in Outlook Search tool, as well as a web based search tool and more importantly the add in puts an “Archive Folder” in their folder list to show where items are located. Combine that with the journaling there appears to be no need to have all those stubs in the mailbox. We just had to decide at what point do we remove the stubs, and how much potential e-mail do we allow them to gather in their e-mail box.

It was at this point we decided how the setup was going to be;

  • 250MB Mailboxes for GenPop, 500MB for Executives
  • 10MB attachment size limit
  • No more then 90 days in Deleted Items Folder
  • No more then 365 days with in rest of e-mail box.

Resolution:

Question is how do we get there.

  • Set the Mailbox Issue Warning at 250MB:
    Set-MailboxDatabase -Identity "Server1\MailboxDatabase1″ -IssueWarningQuota 262144000-QuotaNotificationSchedule "Sun.2:00-Sun.3:00″,"Wed.2:00-Wed.3:00″
  • Set 10MB Attachment
    Set-TransportConfig -MaxReceiveSize 10MB -MaxSendSize 10MB
  • Create the Retention Policy, and Policy Tags. (More on that later)
  • Apply the Retention Policies.


Given we had to apply the retention policies on a migration type schedule we had to create a script in order to do that in stages by using a filter to return the results we wanted, parse that data, then send that to the EMS Commands. The below powershell commands can be created to a PS1 and altered for your enviorment.

### Add's Exchange 2010 Powershell Functionality to Powershell Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010

### THIS SEARCHES AND LISTS THE ACCOUNT NAME BY SEARCHING TWO DIFFERENT LETTERS # THIS IS MEANT TO CATCH UP SINCE MRM POLICES HAVEN'T BEEN APPLIED TO EXCHANGE YET # In the future you can remove the -Filter and just do them all. # Outputs to c:\temp

$FilterContent = {$_.RecipientType -eq "UserMailbox"}
Get-Mailbox | Where-Object $FilterContent | Select-Object Alias | Out-File C:\temp\UsersToProcess.txt

#Trimming the Out-File Content for use by Exchange

(Get-Content "C:\temp\UsersToProcess.txt") -notmatch "Alias" | Out-File "C:\temp\UsersToProcess.txt" (Get-Content "C:\temp\UsersToProcess.txt") -notmatch "—-" | Out-File "C:\temp\UsersToProcess.txt" $TrimUsersToProcess = Get-Content "C:\temp\UsersToProcess.txt" $TrimUsersToProcess.Trim() | Out-File C:\temp\UsersToProcess.txt

### Setting the Retention Policy

$RetentionPolicyName = $RetentionPolicyName =
$SetRetentionUsers = Get-Content "C:\temp\UsersToProcess.txt" ForEach($RetentionUser In $SetRetentionUsers) {$SetRetentionComment = Set-Mailbox -Identity $RetentionUser -RetentionComment '$RetentionPolicyComment'}
ForEach($RetentionUser In $SetRetentionUsers) {$SetRetentionComment = Set-Mailbox -Identity $RetentionUser -RetentionPolicy 		'$RetentionPolicyName'}

### Confirmation of Results Get-Mailbox | Where-Object $FilterContent | Select-Object SamAccountName, RetentionPolicy, RetentionComment | FT

Write-Host -foregroundcolor "Cyan" 'You should see a table where everyone has a Retenion Policy that matches $RetentionPolicyName'