Select Page
This entry has been published on 2014-07-01 and may be out of date.

Last Updated on 2014-07-01.

It might happen that users in your network unintentionally delete single mails, subfolders, contacts etc. which are not restorable.

In many cases, solutions like Windows Server Backup and several 3rd party Exchange Backup software do not give the best possibilities you need for restoring single records of >70 GB EDB databases’s backup files, and/or are slow or too complicated or expensive.

One solution could be using the following Powershell script. It exports all mailboxes as .pst file and considers time ranges, e.g. to export only the last year to reduce file sizes.

The big advantage of PST files is you can quickly open them via Outlook and extract the data of your choice within seconds.


[System.Reflection.Assembly]::LoadWithPartialName("System.Threading")
[System.Reflection.Assembly]::LoadWithPartialName("System.Globalization")
[System.Threading.Thread]::CurrentThread.CurrentCulture = [System.Globalization.CultureInfo]::CreateSpecificCulture("en-us")

Add-PSSnapin *exchange*

$startdate = (Get-Date).AddYears(-1)
echo $startdate

Get-MailboxExportRequest | Remove-MailboxExportRequest -Confirm:$false

foreach ($i in (Get-Mailbox))
{
    New-MailboxExportRequest -Mailbox $i -ContentFilter "Received -gt '$startdate'" -FilePath \filesnobackuppst_exports$($i.Alias.Replace("|", " ")).pst
}

Note: The first three lines are needed to get the right DateTime format for the $startdate variable, if you live in a Non-US region.

UPDATE

The script from this site also includes settings like “max. concurrent exports”. Note, if you want to use it, you also have to add the first three lines (Reflection, …) if you want to add the contentfilter parameter.

Reference:

http://occasionalutility.blogspot.com.au/2014/03/everyday-powershell-part-17-using-new.html