SOLVED

Exchange 2016 ComplianceSearch not work

Copper Contributor
hi everyone,
 

I want to soft delete all email contents in multi mailboxes in bulk.  New-ComplianceSearchAction cmdlet seems could achieve it, but it just could delete 10 messages one time..

i tested cmdlets below, but return results are zero.

 

 

New-ComplianceSearch -Name "test" -ExchangeLocation "<user id>" | Start-ComplianceSearch

Get-ComplianceSearch | FL name,items,size,jobprogress,status

New-ComplianceSearchAction -SearchName "test" -Purge -PurgeType SoftDelete

 

 

Snipaste_2021-11-30_09-18-09.jpg

 Can you help me why search result is blank?

4 Replies
Why don't you just use good old Search-Mailbox?

@VasilMichev  hi Vasil, because i dont want to hard delete message, in case someone needs  recover messages..

best response confirmed by thorrr7 (Copper Contributor)
Solution
If you have single-item recovery enabled, they won't be permanently deleted. Same if the mailbox is on hold. And you can always use the other switched to make a copy of the deleted content. Bets having to run the same thing 100x times, at least in my book :)

As to why you're not getting any results, I'm not sure. Try adding some generic query instead, although it *should* include the whole content of the mailbox when no keywords are provided...
single-item recovery enbaled works~
i tried add ContentMatchQuery parameter, but result is the same..
1 best response

Accepted Solutions
best response confirmed by thorrr7 (Copper Contributor)
Solution
If you have single-item recovery enabled, they won't be permanently deleted. Same if the mailbox is on hold. And you can always use the other switched to make a copy of the deleted content. Bets having to run the same thing 100x times, at least in my book :)

As to why you're not getting any results, I'm not sure. Try adding some generic query instead, although it *should* include the whole content of the mailbox when no keywords are provided...

View solution in original post