Commands › Exchange Online
Set-FeatureConfiguration
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)
Reference facts derived from Microsoft documentation, © Microsoft, licensed CC BY 4.0; restructured with original guidance by serv365.ai.