Tuesday, October 08, 2013

Export Emails within a Date Range from Exchange 2010

Today I had to do this to assist with an email audit for a government agency.  Below are the steps you need to follow to make this happen.  The TechNet article leaves out a very important step that I have included for you below.


1. Open up the Exchange Management Shell and enter the following command:  New-ManagementRoleAssignment –Role “Mailbox Import Export” –User "DOMAIN\USERACCOUNT"

**NOTE:  Now close the EMS and reopen it.  You have to do this because the roles for the user logged in are loaded when the EMS is started.

2. Use this command to export your email date range and the location where you want to save it: New-MailboxExportRequest -Mailbox "SAMPLE USER" -ContentFilter {(Received -lt '01/01/2012') -and (Received -gt '03/31/2012')}  -FilePath "\\SERVER\EXPORTS\SAMPLE_USER.pst"

Depending on the size of the user's email you may get a file rather quickly or you may get a message from the EMC that the job is queued and will be filled when it is completed the search and export process.

What lead me here was the error "The Term 'New-MailboxExportRequest' is not recognized as the name of a cmdlet, function, script file, or operable program".

The steps above will avoid this error and get you exactly what you need from the email box.

If you just want to dump the entire mailbox use this:  New-MailboxExportRequest -Mailbox "SAMPLE USER" -FilePath "\\SERVER\EXPORTS\SAMPLE_USER.pst"

No comments: