Commands › Exchange Online

New-TeamsProtectionPolicy

Exchange Online ExchangeOnlineManagement New-*

Create Microsoft Teams protection policies. **Note**: If the policy already exists (the Get-TeamsProtectionPolicy cmdlet returns output), you can't use this cmdlet.

Quick start script

# New-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)
New-TeamsProtectionPolicy -Name <String> -WhatIf
New-TeamsProtectionPolicy -Name <String>

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

Syntax

New-TeamsProtectionPolicy [-Name] <String>
 [-Confirm]
 [-HighConfidencePhishQuarantineTag <String>]
 [-MalwareQuarantineTag <String>]
 [-Organization <OrganizationIdParameter>]
 [-WhatIf]
 [-ZapEnabled <Boolean>]
 [<CommonParameters>]

Parameters (7)

ParameterTypeRequiredWhat it controls
-Name String yes The Name parameter specifies the unique name of the Teams protection policy. If the value contains spaces, enclose the value in quotation marks. The default name of the Teams protection policy in an organization is...
-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:
-Organization OrganizationIdParameter This parameter is reserved for internal Microsoft use.
-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.