Commands › Exchange Online

Set-SensitiveInformationScanRule

Exchange Online ExchangeOnlineManagement Set-*

For more information, see Security & Compliance PowerShell. Use the Set-SensitiveInformationScan cmdlet to modify sensitive information scan rules.

Quick start script

# Set-SensitiveInformationScanRule — quick start (serv365.ai)
# 1. Connect (app-only shown; interactive: omit the certificate parameters)
Connect-ExchangeOnline -CertificateThumbprint $thumb -AppId $appId -Organization $org

# 2. Capture the current state first — you cannot roll back what you never recorded
$before = Get-SensitiveInformationScanRule
$before | Format-List

# 3. Make the change (dry run first)
Set-SensitiveInformationScanRule -Identity <ComplianceRuleIdParameter> -WhatIf
Set-SensitiveInformationScanRule -Identity <ComplianceRuleIdParameter>

# 4. Verify and diff
$after = Get-SensitiveInformationScanRule
Compare-Object ($before | Out-String) ($after | Out-String)

Syntax

Set-SensitiveInformationScanRule [-Identity] <ComplianceRuleIdParameter>
 [-Comment <String>]
 [-Confirm]
 [-ContentCreatedOrUpdatedDateFrom <System.DateTime>]
 [-ContentCreatedOrUpdatedDateTo <System.DateTime>]
 [-ContentExtensionMatchesWords <MultiValuedProperty>]
 [-ContentPropertyContainsWords <MultiValuedProperty>]
 [-ExceptIfContentExtensionMatchesWords <MultiValuedProperty>]
 [-ExceptIfContentPropertyContainsWords <MultiValuedProperty>]
 [-StartImpactAssessment <Boolean>]
 [-WhatIf]
 [-Workload <PolicyConfiguration.Workload>]
 [<CommonParameters>]

Parameters (12)

ParameterTypeRequiredWhat it controls
-Identity ComplianceRuleIdParameter yes The Identity parameter specifies the sensitive information scan rule that you want to modify. You can use any value that uniquely identifies the rule. For example:
-Comment String The Comment parameter specifies an optional comment. If you specify a value that contains spaces, enclose the value in quotation marks ("), for example: "This is an admin note".
-Confirm SwitchParameter The Confirm switch specifies whether to show or hide the confirmation prompt. How this switch affects the cmdlet depends on whether the cmdlet requires confirmation before proceeding.
-ContentCreatedOrUpdatedDateFrom DateTime The ContentCreatedOrUpdatedDateFrom parameter specifies the earliest modification date-time of files that are considered in scope of this scan.
-ContentCreatedOrUpdatedDateTo DateTime The ContentCreatedOrUpdatedDateTo parameter specifies the latest modification date-time of files that are considered in scope of this scan.
-ContentExtensionMatchesWords MultiValuedProperty The ContentExtensionMatchesWords parameter specifies a condition for the rule that looks for words in file extensions. You can specify multiple words separated by commas. Irrespective of the original file type, this...
-ContentPropertyContainsWords MultiValuedProperty The ContentPropertyContainsWords parameter specifies a condition for the rule that's based on a property match in content. The rule is applied to content that contains the specified property.
-ExceptIfContentExtensionMatchesWords MultiValuedProperty The ExceptIfContentExtensionMatchesWords parameter specifies an exception for the rule that looks for words in file extensions. You can specify multiple words separated by commas. Irrespective of what the original...
-ExceptIfContentPropertyContainsWords MultiValuedProperty The ExceptIfContentPropertyContainsWords parameter specifies an exception for the DLP rule that's based on a property match in content. The rule is not applied to content that contains the specified property.
-StartImpactAssessment Boolean The StartImpactAssessment parameter specifies whether to start a scan estimation. Valid values are:
-WhatIf SwitchParameter The WhatIf switch doesn't work in Security & Compliance PowerShell.
-Workload Workload The Workload parameter specifies the workload. Valid values are:

Reference facts derived from Microsoft documentation, © Microsoft, licensed CC BY 4.0; restructured with original guidance by serv365.ai.