Link to home
Start Free TrialLog in
Avatar of big_daddy0690
big_daddy0690Flag for United States of America

asked on

How to format ContentFilter parameter for New-MailboxExportRequest

I need help with the proper formatting to group ContentFilter properties to get the desired output for the export. I'd like emails sent after 3/31/12 that have either of the two participants.

The following returns an empty pst file:

New-MailboxExportRequest -Mailbox "username" -FilePath "\\Server\Share\username.pst" -ContentFilter {((Participants -eq "user1@domain.com") -or (Participants -eq "user2@domain.com")) -and (Sent -gt "03/31/2012")}

Open in new window

Avatar of chrismerritt
chrismerritt

Hello, one idea I have is using a -match statement to match mulitple strings in one go, try this instead:
New-MailboxExportRequest -Mailbox "username" -FilePath "\\Server\Share\username.pst" -ContentFilter {(Participants -match "user1@domain.com|user2@domain.com") -and (Sent -gt "03/31/2012")}

Open in new window

Also check your datetime is actually the datetime you think it is. Sometimes servers don't run the same locales and switch the days and months around. In the window just enter this and check it comes back with 31st March:
[datetime]"03/31/2012"

Open in new window

Avatar of big_daddy0690

ASKER

I get an error back stating that -match is not a valid operator. I believe ContentFilter has a limited set of operators.
ASKER CERTIFIED SOLUTION
Avatar of chrismerritt
chrismerritt

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I've come to the conclusion that ContentFilter has its issues. I can not get any type of recipient type filter to provide results even when that is the only filter. Date and other filters work as expected.

I ended up just using the date filter to export and then used the mail client to filter the results further.

Thank you for the suggestions.