PowerShell: Checking the Syntax of an Exchange Mailbox Export Content Filter

A bit of a niche function this one.  When you perform a mailbox export in Exchange using the New-MailboxExportRequest cmdlet you can specify the ContentFilter parameter.  This allows you to pass an OPATH filter to only export SOME of the content from a mailbox.

One of the examples on the page above is;

New-MailboxExportRequest -Mailbox Tony -ContentFilter {(body -like “*company*”) -and (body -like “*profit*”) -and (Received -lt “01/01/2012”)}

So what if you need to check the syntax of a ContentFilter? Continue reading “PowerShell: Checking the Syntax of an Exchange Mailbox Export Content Filter”