SOLVED

Delete emails

%3CLINGO-SUB%20id%3D%22lingo-sub-1624664%22%20slang%3D%22en-US%22%3EDelete%20emails%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1624664%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20All%3C%2FP%3E%3CP%3Ei%20am%20using%20the%20below%20syntax%20to%20delete%20email%20but%20i%20am%20unable%20to%2C%20can%20anyone%20correct%20the%20syntax%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-powershell%22%3E%3CCODE%3ENew-ComplianceSearch%20-Name%20%22user1_search%22%20-ExchangeLocation%20user1%40contoso.com%20-ContentMatchQuery%20'%22Received%3A08%2F18%2F2020%2000%3A00..08%2F20%2F2020%2023%3A59%22%20AND%20from%3A%22test%40gmail.com%22%20AND%20Subject%3A%22Test've%20Test-abcdef%20msggg%22'%0Astart-compliancesearch%20%22user1_search%22%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1624664%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAdmin%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ECompliance%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EExchange%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Ehybrid%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EOffice%20365%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1625514%22%20slang%3D%22en-US%22%3ERe%3A%20Delete%20emails%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1625514%22%20slang%3D%22en-US%22%3E%3CP%3EYou%20are%20only%20running%20a%20search%2C%20not%20performing%20any%20deletions.%20Read%20the%20documentation%3A%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fmicrosoft-365%2Fcompliance%2Fsearch-for-and-delete-messages-in-your-organization%3Fview%3Do365-worldwide%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fmicrosoft-365%2Fcompliance%2Fsearch-for-and-delete-messages-in-your-organization%3Fview%3Do365-worldwide%3C%2FA%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
Frequent Contributor

Hi All

i am using the below syntax to delete email but i am unable to, can anyone correct the syntax

 

New-ComplianceSearch -Name "user1_search" -ExchangeLocation user1@contoso.com -ContentMatchQuery '"Received:08/18/2020 00:00..08/20/2020 23:59" AND from:"test@gmail.com" AND Subject:"Test've Test-abcdef msggg"'
start-compliancesearch "user1_search"
1 Reply
best response confirmed by Rising Flight (Frequent Contributor)
Solution

You are only running a search, not performing any deletions. Read the documentation: https://docs.microsoft.com/en-us/microsoft-365/compliance/search-for-and-delete-messages-in-your-org...