Validate-RetentionRuleQuery

This cmdlet is available only in Security & Compliance PowerShell. For more information, see Security & Compliance PowerShell.

Use the Validate-RetentionRuleQuery cmdlet to validate the Keyword Query Language (KQL) content search filters for retention rules.

For information about the parameter sets in the Syntax section below, see Exchange cmdlet syntax.

Syntax

Validate-RetentionRuleQuery
        -KqlQueryString <String>
        [<CommonParameters>]

Description

To use this cmdlet in Security & Compliance PowerShell, you need to be assigned permissions. For more information, see Permissions in the Microsoft Purview compliance portal.

Examples

Example 1

Validate-RetentionRuleQuery -KqlQueryString 'from:"Ann Beebe" AND subject:northwind'

This example validates the specified KQL content search filter.

Parameters

-KqlQueryString

The KqlQueryString parameter specifies the KQL text search string that you want to validate.

This parameter uses a text search string or a query that's formatted by using the Keyword Query Language (KQL). For more information, see Keyword Query Language (KQL) syntax reference and Keyword queries and search conditions for eDiscovery.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False
Applies to:Exchange Online, Security & Compliance