Commands › Exchange Online

Set-FeatureConfiguration

Exchange Online ExchangeOnlineManagement Set-*

For more information, see Security & Compliance PowerShell. > [!NOTE] > This cmdlet is currently available in Public Preview, isn't available in all organizations, and is subject to change. Use the Set-FeatureConfiguration cmdlet to modify Microsoft Purview feature configurations within your organization, including: - Collection policies. - Advanced label based protection.

Quick start script

# Set-FeatureConfiguration — 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-FeatureConfiguration
$before | Format-List

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

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

Syntax

Set-FeatureConfiguration [-Identity] <PolicyIdParameter> [-Locations <String>]
 [-Comment <String>]
 [-Confirm]
 [-Mode <PolicyMode>]
 [-ScenarioConfig <String>]
 [-WhatIf]
 [<CommonParameters>]

Parameters (7)

ParameterTypeRequiredWhat it controls
-Identity PolicyIdParameter yes The Identity parameter specifies the feature configuration that you want to modify. You can use any value that uniquely identifies the policy. 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.
-Locations String The locations parameter specifies where the feature configuration applies.
-Mode PolicyMode The Mode parameter specifies feature configuration mode. Valid values are:
-ScenarioConfig String The ScenarioConfig parameter specifies additional information about the feature configuration.
-WhatIf SwitchParameter The WhatIf switch doesn't work in Security & Compliance PowerShell.

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