MailboxExportRequest ContentFilter is "Received -ne $null" when querying by date

Solution 1:

It's a finicky syntax error and made worse by incorrect/unclear documentation. Please try the following --

$y = ((get-date).addDays(-1)).ToShortDateString()
$exportRequest = New-MailboxExportRequest -ContentFilter "Received -lt '$y'" -mailbox userID -FilePath \\SHARED\folder\userID.pst