Quantcast
Channel: Exchange Server 2013 - Administration, Monitoring, and Performance 论坛
Viewing all articles
Browse latest Browse all 3457

Delete messages from specific date range using searchquery cmdlet

$
0
0

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 


Viewing all articles
Browse latest Browse all 3457

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>