Commands › Exchange Online

Set-TeamsProtectionPolicy

Exchange Online ExchangeOnlineManagement Set-*

Modify Microsoft Teams protection policies.

Quick start script

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

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

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

Syntax

Set-TeamsProtectionPolicy [-Identity] <TeamsProtectionPolicyIdParameter>
 [-AdminDisplayName <String>]
 [-Confirm]
 [-HighConfidencePhishQuarantineTag <String>]
 [-MalwareQuarantineTag <String>]
 [-WhatIf]
 [-ZapEnabled <Boolean>]
 [<CommonParameters>]

Parameters (7)

ParameterTypeRequiredWhat it controls
-Identity TeamsProtectionPolicyIdParameter yes The Identity parameter specifies the Teams protection policy that you want to modify. There's only one Teams protection policy in an organization named Teams Protection Policy.
-AdminDisplayName String The AdminDisplayName parameter specifies a description for the policy. If the value contains spaces, enclose the value in quotation marks (").
-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.
-HighConfidencePhishQuarantineTag String The HighConfidencePhishQuarantineTag parameter specifies the quarantine policy that's used for messages that are quarantined as high confidence phishing by ZAP for Teams. You can use any value that uniquely...
-MalwareQuarantineTag String The MalwareQuarantineTag parameter specifies the quarantine policy that's used for messages that are quarantined as malware by ZAP for Teams. You can use any value that uniquely identifies the quarantine policy. For example:
-WhatIf SwitchParameter The WhatIf switch shows what the command does without making any changes. You don't need to specify a value with this switch.
-ZapEnabled Boolean The ZapEnabled parameter specifies whether to enable zero-hour auto purge (ZAP) for malware and high confidence phishing messages in Teams messages. Valid values are:

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