Tuesday, June 7, 2011

Powershell - Enable Domestic Mailboxes for Archiving in Exchange

Configuring mailboxes for archiving is a time-consuming task. Identity management was supposed to handle this automatically, but that does not yet seem to be reliable. After some time, you may discover that a large group of mailboxes are not yet enabled for archiving. The following steps will allow you to enable an entire group of mailboxes for archiving (on the Exchange side, anyway).
 
This particular example queries Exchange for all databases except those specifically excluded (see the WHERE clause), then retrieves all the remaining mailboxes which do not have a ManagedFolderMailboxPolicy configured (field is $null).
 
First, query Exchange for all domestic mailboxes which do not have a ManagedFolderMailboxPolicy set, and assign those objects to the variable $mbx. We do this so that we can use the variable (which contains objects) to pipe those objects to other Exchange commands.
 
$mbx = (Get-MailboxDatabase -Server EXCHANGESERVER | where {$_.Name -ne "Germany Users" -And $_.Name -ne "Italy Users" -And $_.Name -ne "Sweden Users" -And $_.Name -ne "Canada Users"} | Get-Mailbox | where {$_.ManagedFolderMailboxPolicy -eq $null})
 
Next, set the ManagedFolderMailboxPolicy on each of the mailbox objects.
 
$mbx | set-mailbox -ManagedFolderMailboxPolicy "Delete Anything Over One Year"
 
Next, add all the mailbox objects to the appropriate distribution group (used for provisioning by Enterprise Vault).
 
$mbx | Add-DistributionGroupMember -identity "Email Archiving Group"
 
Finally, pipe the mailbox objects to the Start-ManagedFolderAssistant command. This will force Exchange to create the Managed Folders in each user's mailbox, per the ManagedFolderMailboxPolicy.

$mbx | Start-ManagedFolderAssistant
 
That's it for the Exchange side. All that's left to do is to provision and enable the mailboxes for archiving in Enterprise Vault.
 
  • Mike
 
 

No comments:

Post a Comment