How to Exchange 2010 mailbox to PST with Date Range

This could be a great idea to export data for a particular date range in Exchange Server 2010, rather than exporting complete mailbox only for selective data. Sometime as an Exchange Administrator I need to export only selective mailbox item in a time range for keep the data as backup, or one of the user used to do this for create a monthly archive for a particular mailbox.

Fortunately, Exchange Server 2010 runs PowerShell command New-MailboxExportRequest filters and export data with a date range. Let’s take an example where I’ll export the entire messages in the report mailbox which have been received in January 2015.

New-MailboxExportRequest -ContentFilter {(Received -lt ’02/01/2015′) -and (Received -gt ’12/31/2014′)} -Mailbox report -FilePath \\srv-ex2k13mb01\d$\report_Export_January2015.pst

The above scripts will scan and export all the messages in PST file kept in D drive, which have received before February the 2nd and after December the 31th.

However if you want to customize filter in the above PowerShell command, it isn’t over yet. The –ContentFilter parameters takes bunch of filterable properties to export only desired mailbox data in PST form. Let’s take another example-

Rather than specific date range, you can also export all those email which sent to report mailbox from user JohnPlayer. Run the following command-

New-MailboxExportRequest -ContentFilter {ContentFilter {Sender -eq ‘johnplayer@info.com’}} -Mailbox report -FilePath \\srv-ex2k13mb01\d$\report_Export.pst

You can also tweak mailbox export command to export only selective items that match with subject line Deals. Run the following command to execute this-

New-MailboxExportRequest -ContentFilter {ContentFilter {Subject -like *Deals*}} -Mailbox report -FilePath \\srv-ex2k13mb01\d$\report_Export.pst

If you want to export all the messages which sent between a date range, run this exchange cmdlets-

New-MailboxExportRequest -ContentFilter {(Sent -lt ’02/01/2014′) -and (Sent -gt ’12/31/2014′)} -Mailbox report -FilePath \\szhex04\d$\report_Send_Export_data_Dec2013.pst

Unfortunately, there is no GUI option available in Exchange Server 2010 for export user’s mailbox data to .pst between certain dates. But the good thing is that you can use cmdlets to export selective data from the mailbox.