Exchange 2007 Server-side archiving

Published on
9,665 Points
1 Endorsement
Last Modified:
The purpose of this is to allow you as an exchange administrator to archive large mailboxes by date. This, with a little bit of modification this can be scripted and scheduled to allow compliance with enterprise mail policies. This WILL NOT WORK CORRECTLY if the mailboxes are 20gb or over.

(I used a virtual machine for all of this)
32-bit O/S  (Windows XP is fine)
Microsoft Outlook 2007 installed
Exchange 2007 management tools
Sufficient Hard disk space for the mail you will be archiving.

[u] Assumptions [/u]
the machine mentioned above is running as the user "domain\mailboxadmin" and you will be archiving the mailbox "mailboxalias". "c:\pstfiles" is where you pst files will go after archiving.

[u] Permissions [/u]
once all of this is up and running, you need to ensure that the user that you will be running this from has FullAccess to the mailboxes you are archiving.
From the powershell,
Add-MailboxPermission -Identity mailboxalias -AccessRights FullAccess domain\mailboxadmin

this will grant your user access to the mailbox mailboxalias

[u] Archiving [/u]
the below command will move the emails prior to 30/12/2008 to c:\PSTFiles\mailboxname.pst . if you only want to copy and not move, simply remove "-deletecontent" from the command.  
export-mailbox -Identity MailboxAlias -EndDate "30/12/2008" -ExcludeFolders ,"\Contacts","\Journal","\Calendar","\Sync Issues","\Drafts","\Notes","\Tasks","\Outbox" -PstFolderPath C:\PSTFiles\ -DeleteContent -confirm:$false -BadItemLimit 1000

Open in new window

[u] Bulk Archiving [/u]
The below command will do the same for every mailbox in the Mailbox Database on the first storage group of the mailbox server MailServer
Get-Mailbox -Database "MailServer\First Storage Group\Mailbox Database" | export-mailbox  -EndDate "30/12/2008" -ExcludeFolders ,"\Contacts","\Journal","\Calendar","\Sync Issues","\Drafts","\Notes","\Tasks","\Outbox" -PstFolderPath C:\PSTFiles\ -DeleteContent -confirm:$false -BadItemLimit 1000

Open in new window


Featured Post

Creating Active Directory Users from a Text File

If your organization has a need to mass-create AD user accounts, watch this video to see how its done without the need for scripting or other unnecessary complexities.

Join & Write a Comment

This video demonstrates how to sync Microsoft Exchange Public Folders with smartphones using CodeTwo Exchange Sync and Exchange ActiveSync. To learn more about CodeTwo Exchange Sync and download the free trial, go to: http://www.codetwo.com/excha…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Other articles by this author

Keep in touch with Experts Exchange

Tech news and trends delivered to your inbox every month