Commands › Exchange Online
New-ProtectionAlert
For more information, see Security & Compliance PowerShell. Use the New-ProtectionAlert cmdlet to create alert policies in the Microsoft Purview compliance portal and the Microsoft Defender portal. Alert policies contain conditions that define the user activities to monitor, and the notification options for email alerts and entries. > [!NOTE] > Although the cmdlet is available, you receive the following error if you don't have an enterprise license: > > _Creating advanced alert policies requires an Office 365 E5 subscription or Office 365 E3 subscription with an Office 365 Threat Intelligence
Quick start script
# New-ProtectionAlert — 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-ProtectionAlert
$before | Format-List
# 3. Make the change (dry run first)
New-ProtectionAlert -Category <AlertRuleCategory> -Name <String> -NotifyUser <MultiValuedProperty> -WhatIf
New-ProtectionAlert -Category <AlertRuleCategory> -Name <String> -NotifyUser <MultiValuedProperty>
# 4. Verify and diff
$after = Get-ProtectionAlert
Compare-Object ($before | Out-String) ($after | Out-String)
Syntax
New-ProtectionAlert -Category <AlertRuleCategory> -Name <String> -NotifyUser <MultiValuedProperty> -ThreatType <ThreatAlertType>
[-AggregationType <AlertAggregationType>]
[-AlertBy <MultiValuedProperty>]
[-AlertFor <MultiValuedProperty>]
[-Comment <String>]
[-Confirm]
[-CorrelationPolicyId <System.Guid>]
[-Description <String>]
[-Disabled <Boolean>]
[-Filter <String>]
[-LogicalOperationName <String>]
[-NotificationCulture <CultureInfo>]
[-NotificationEnabled <Boolean>]
[-NotifyUserOnFilterMatch <Boolean>]
[-NotifyUserSuppressionExpiryDate <DateTime>]
[-NotifyUserThrottleThreshold <Int32>]
[-NotifyUserThrottleWindow <Int32>]
[-Operation <MultiValuedProperty>]
[-PrivacyManagementScopedSensitiveInformationTypes <MultiValuedProperty>]
[-PrivacyManagementScopedSensitiveInformationTypesForCounting <MultiValuedProperty>]
[-PrivacyManagementScopedSensitiveInformationTypesThreshold <System.UInt64>]
[-CustomProperties <PswsHashtable>]
[-Severity <RuleSeverity>]
[-Threshold <Int32>]
[-TimeWindow <Int32>]
[-UseCreatedDateTime <System.Boolean>]
[-VolumeThreshold <System.UInt64>]
[-WhatIf]
[<CommonParameters>]
Parameters (31)
Reference facts derived from Microsoft documentation, © Microsoft, licensed CC BY 4.0; restructured with original guidance by serv365.ai.