Yes, change the PurgeType value to HardDelete. Refer to the cmdlet help for more details: https://learn.microsoft.com/en-us/powershell/module/exchange/new-compliancesearchaction?view=exchange-ps#-purgetype
Questions about using the powershell command to permanently delete phishing emails
Run the powershell command to query all emails with the subject "3232323" and delete them
Deleted messages will be saved in "Deleted message" > "Restore deleted items"
Is there any way to permanently delete a message for all mailboxes, that is, deleted messages are not saved in Restore deleted items?
The command is as follows
New-ComplianceSearch -Name "Remove-Mail-Message-1" -ExchangeLocation all -ContentMatchQuery "sent>=01/28/2024 AND sent<=02/28/2024 AND Subject:'3232323'" Start-ComplianceSearch -Identity "Remove-Mail-Message-1" New-ComplianceSearchAction -SearchName "Remove-Mail-Message-1" -Purge -PurgeType SoftDeleteRun the powershell command to query all emails with the subject "3232323" and delete them
Exchange Exchange Server Other
Exchange Exchange Server Management
Windows for business Windows Server User experience PowerShell
3 answers
Sort by: Most helpful
-
Vasil Michev 119.5K Reputation points MVP Volunteer Moderator
2024-01-31T08:30:58.5366667+00:00 -
cscowx 0 Reputation points
2024-02-02T06:38:00.02+00:00 Hi,I'm not sure if the SearchQuery in search-Mailbox doesn't support Chinese text queries
Can you take a look at it for me
$Subject = "中国飞象"
Search-Mailbox -Identity "******@semidrive.cc" -SearchQuery "Subject:$($Subject)" -EstimateResultOnly
RunspaceId : 2a346e7c-6b08-4f0d-b438-46549061be7b
Identity : semidrive.cc/Employee/IT/python123
TargetMailbox :
Success : True
TargetFolder :
ResultItemsCount : 0
ResultItemsSize : 0 B (0 bytes)
-
Anonymous
2024-02-02T09:34:59.9833333+00:00 Hello @cscowx ,
Yep, based on our experience and some user feedback we have seen in the past, when the theme contains Chinese, it may not be possible to search accurately.
If the email subject you want to batch search happens to contain Chinese, it is recommended that if you cannot search for the email when using Search-Mailbox, you could try to match it by adjusting the length of the keywords contained in the subject, combining it with other filtering conditions such as date ranges, etc. to the mail. There is a Chinese post discussing related issues here. You could also refer to it:https://learn.microsoft.com/en-us/answers/questions/1457734/exchange2019