Use KQL in Microsoft Purview Content Search
Question details
The user wants to create a Content Search using KQL and understand whether a command line is needed to edit the query.

- Product
- Microsoft Purview Content Search
- Device & OS
- not provided
- Scenario
- The user wants to search Microsoft 365 content using keywords and search conditions.
- Observed behavior
- The user needs to know where to enter KQL and how search conditions contribute to the query.
Sign in to Microsoft Purview with an account that has permission to create and run content searches. Identify the mailboxes or sites to search and check Microsoft's documentation for supported KQL properties.
Enter KQL in the Content Search interface
Use the search interface to enter keywords and add conditions without a command line.
Sign in to the Microsoft Purview portal and open Content search or eDiscovery, depending on your portal version. Create a new search.
In the search setup, select the mailboxes, sites, or other available locations you want to search.
In the Keywords field, type search terms or a supported KQL expression, such as subject:"Quarterly report".
Select Add condition and choose available properties, such as a date or sender, to narrow the search. The conditions contribute clauses to the query.
Review the query and selected locations, then select the option to run the search. Review the results in the portal.

Edit a Content Search query with PowerShell
Use Security & Compliance PowerShell if you prefer to update a search query from a command line.
Review Office Documents with WPS Office
WPS Office is a free, lightweight alternative for working with Office documents. Its familiar interface and format support make it easy to move everyday document work from Microsoft Office. It does not run Microsoft Purview compliance searches.

Frequently Asked Questions
Do I need a command line to run KQL in Content Search?
No. Enter keywords or a KQL expression directly in the search's Keywords field, and use Add condition to narrow the search.
How do search conditions affect the KQL query?
Each condition selected in the search interface contributes a clause to the query. Review the supported properties and syntax in Microsoft's KQL documentation.
Can I edit an existing search from PowerShell?
If your environment supports the command and you have the required permissions, connect with Connect-IPPSSession and use Set-ComplianceSearch with the search identity and ContentMatchQuery parameter.
Why can't I find Content Search in the old Security and Compliance Center?
Microsoft has moved compliance tools into Microsoft Purview. Look for Content search or eDiscovery in the Purview portal, and check that your account has the required permissions.




