The script used to work but since we upgraded to Exchange 2013, this stopped working. Every month, we go in and delete any messages with the subject "Weekly Event" from
a specific date and before. It pulls all mailboxes from a specific OU. the script below I thought worked. Is there a new command or is there something I'm missing?
Get-Mailbox -OrganizationalUnit "Contoso/City Departments/Managers" | Search-Mailbox -SearchQuery "Subject: 'Weekly Event' Sent:<09/30/2013" -TargetMailbox "bbarker" -TargetFolder "backup" -LogLevel Full –DeleteContent
I tried without the date and it worked. So, it has something to do with the date range.
Thank you for your help.
Tim