Author Posts

January 1, 2012 at 12:00 am

by awmcgregor at 2012-08-24 12:34:22

I need to export mail items except for ones that come from or have been sent to particular addresses. I'm using the commands below but I get all of the messages I tried to exclude along with the rest. I need some help.

New-MailboxExportRequest mbxalias -ContentFilter {to -ne 'user@domain.com'} -FilePath \\server\pstexport\userexport.pst -ExcludeDumpster

Thanks,
Andrew

by MikePfeiffer at 2012-08-27 12:48:54

Based on the documentation your code should work, but I tried it here as well and it doesn't look like it does. I'll try to find out if this is a bug or if some other undocumented syntax is required.

by awmcgregor at 2012-11-13 13:41:12

Hello,
Is there any update on this issue?? I have a similar issue, and I don't know if it has to do with the variable I'm using or some other issue. I'm trying to export all items in a certain mailbox that are received in the last 24 hours. I need this to run every day at a particular time, so I'm using the get-date cmdlet and then using the .addDays(-1) to create a start date for my Content filter. However, just as the poster above, I get everything instead of just the one day. If I take the contents of my variable that has the start date and time and paste in verbatim into the script, I get the right output. Below are what my commands look like.

$today = get-date
$yesterday = $today.addDays(-1)
$start = '"'+$yesterday+'"'
new-mailboxexportrequest mbxalias -filepath "\\server\folder\" -contentfilter{(received -gt $yesterday)}