Compliance Search query for *@domain.com (Wildcard) ?

EnterpriseArchitect 6,041 Reputation points
2022-09-28T03:41:57.623+00:00

Using the GUI: https://compliance.microsoft.com/contentsearchv2?viewid=search maybe something like:
245336-image.png

May I know what's the command in PowerShell?

New-ComplianceSearch -Name $SearchIdentity -ExchangeLocation All -ContentMatchQuery 'sender:"*@domain.com"   

Because I received this error:
245337-image.png

Thank you in advance.

Exchange Online
Exchange Online
A Microsoft email and calendaring hosted service.
6,174 questions
Exchange | Exchange Server | Management
Windows for business | Windows Server | User experience | PowerShell
Microsoft Security | Microsoft Graph
0 comments No comments
{count} votes

Accepted answer
  1. Vasil Michev 119.6K Reputation points MVP Volunteer Moderator
    2022-09-28T06:12:23.33+00:00

    Remove both the wildcard and the @ sign. Here's an example that only includes emails from specific domain:

    (c:c)(participants:domain.com)(kind=email)  
    New-ComplianceSearch -ContentMatchQuery "(c:c)(participants:domain.com)(kind=email)" -name Domain -ExchangeLocation All  
    

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.