Hi,@Glenn Maxwell
Thanks for posting your question in the Microsoft Q&A forum.
The command you provided looks generally correct, but there are a few things you might want to note:
-ContentMatchQuey
appears to be -ContentMatchQuery
, there is a typo.
As Vasil Michev mentioned, certain special characters are not included in the search index and are therefore not searchable.
According to your request, I conducted the test:
1. I created a CSV file.
![User's image](https://learn-attachment.microsoft.com/api/attachments/2978b2ea-b629-4c9c-a996-baece48adbd8?platform=QnA)
2. Send an email to members with the subject line "Test Test Test Test: This is a spam/phishing email please ignore it, Please delete the email".
![User's image](https://learn-attachment.microsoft.com/api/attachments/82b3444c-ce69-40cb-bc32-8d5349f7c427?platform=QnA)
3. Connect to your organization's Security and Compliance PowerShell.
![User's image](https://learn-attachment.microsoft.com/api/attachments/e68fd59d-930e-4efd-ade9-5f4009e415a2?platform=QnA)
4. Import a CSV file and define search names and subjects.
$users = Import-Csv -Path "C:\Users\brucejing\Documents\test2.csv"
$searchName = "DeleteSpecificEmailSearch1"
$subject = "Test Test Test Test: This is a spam/phishing email please ignore it, Please delete the email"
$searchQuery = "subject:"$($subject)
""
![User's image](https://learn-attachment.microsoft.com/api/attachments/592d4255-754a-4735-9a48-51cef408cd7a?platform=QnA)
5. Create a new search item.
New-ComplianceSearch -Name $searchName -ExchangeLocation $users.EmailAddress -ContentMatchQuery $searchQuery
![User's image](https://learn-attachment.microsoft.com/api/attachments/8a2132fa-d4d3-423c-a109-c0a971182f10?platform=QnA)
6. Start your search.
Start-ComplianceSearch -Identity $searchName
![User's image](https://learn-attachment.microsoft.com/api/attachments/ab5846df-9eaf-4aea-81db-04fb32115d33?platform=QnA)
7. If you want to view the searched emails, you can view them in Microsoft Purview->content.
![User's image](https://learn-attachment.microsoft.com/api/attachments/fdc34328-0009-4fd4-b218-726605af1b6c?platform=QnA)
![User's image](https://learn-attachment.microsoft.com/api/attachments/142568dd-9384-47a9-8b47-449d89b3a030?platform=QnA)
8. Delete the searched emails.
New-ComplianceSearchAction -SearchName $searchName -Purge -PurgeType SoftDelete
![User's image](https://learn-attachment.microsoft.com/api/attachments/7d8974b6-2edd-4f40-84eb-95bf79c8c05c?platform=QnA)
9. After waiting for a while, you will find that the test email has been deleted. The person whose information is deleted will receive an email alerting them.
![User's image](https://learn-attachment.microsoft.com/api/attachments/f615cfbd-50ee-42e5-b1ed-14d6e431b867?platform=QnA)
If my answer is helpful to you, please mark it as the answer so that other users can refer to it. Thank you for your support and understanding.