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

search-mailbox and delete content - The KQL parser threw an exception.

$
0
0

trying to delete content from sent item mailbox by date

Add-PSSnapin Microsoft.Exchange.Management.PowerShell.SnapIn;$mbx = get-mailbox "username"$targettime = (Get-Date).adddays(-180).ToString("MM/dd/yyyy HH:mm")Do { $result = Search-Mailbox -Identity $mbx.Identity -SearchQuery {Sent:"01/01/2000 10:00..$targettime"} -DeleteContent -force -WarningAction Silentlycontinuewrite-host $result.resultitemscount -ForegroundColor Green } Until ($result.resultitemscount -eq 0)

and getting the error massage:

The KQL parser threw an exception.


Viewing all articles
Browse latest Browse all 8719

Trending Articles



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