Commands › Exchange Online

New-HostedOutboundSpamFilterPolicy

Exchange Online ExchangeOnlineManagement New-*

Create outbound spam filter policies in your cloud-based organization.

Quick start script

# New-HostedOutboundSpamFilterPolicy — 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-HostedOutboundSpamFilterPolicy
$before | Format-List

# 3. Make the change
New-HostedOutboundSpamFilterPolicy -Name <String>

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

Syntax

New-HostedOutboundSpamFilterPolicy [-Name] <String>
 [-ActionWhenThresholdReached <OutboundRecipientLimitsExceededAction>]
 [-AdminDisplayName <String>]
 [-AutoForwardingMode <AutoForwardingMode>]
 [-BccSuspiciousOutboundAdditionalRecipients <MultiValuedProperty>]
 [-BccSuspiciousOutboundMail <Boolean>]
 [-NotifyOutboundSpam <Boolean>]
 [-NotifyOutboundSpamRecipients <MultiValuedProperty>]
 [-RecipientLimitExternalPerHour <UInt32>]
 [-RecipientLimitInternalPerHour <UInt32>]
 [-RecipientLimitPerDay <UInt32>]
 [-RecommendedPolicyType <RecommendedPolicyType>]
 [<CommonParameters>]

Parameters (12)

ParameterTypeRequiredWhat it controls
-Name String yes The Name parameter specifies a unique name for the outbound spam filter policy. The maximum length is 64 characters. If the value contains spaces, enclose the value in quotation marks (").
-ActionWhenThresholdReached OutboundRecipientLimitsExceededAction The ActionWhenThresholdReach parameter specifies the action to take when any of the limits specified in the policy are reached. Valid values are:
-AdminDisplayName String The AdminDisplayName parameter specifies a description for the policy. If the value contains spaces, enclose the value in quotation marks (").
-AutoForwardingMode AutoForwardingMode The AutoForwardingMode specifies how the policy controls automatic email forwarding to external recipients. Valid values are:
-BccSuspiciousOutboundAdditionalRecipients MultiValuedProperty The BccSuspiciousOutboundAdditionalRecipients parameter specifies an email address to add to the Bcc field of outgoing spam messages. You can specify multiple email addresses separated by commas.
-BccSuspiciousOutboundMail Boolean The BccSuspiciousOutboundMail parameter specifies whether to add recipients to the Bcc field of outgoing spam messages. Valid values are:
-NotifyOutboundSpam Boolean **Note**: This setting is replaced by the default alert policy named **User restricted from sending email**, which sends notification messages to admins. We recommend that you use the alert policy rather than this...
-NotifyOutboundSpamRecipients MultiValuedProperty **Note**: This setting is replaced by the default alert policy named **User restricted from sending email**, which sends notification messages to admins. We recommend that you use the alert policy rather than this...
-RecipientLimitExternalPerHour UInt32 The RecipientLimitExternalPerHour parameter specifies the maximum number of external recipients that a user can send to within an hour. A valid value is 0 to 10000. The default value is 0, which means the service...
-RecipientLimitInternalPerHour UInt32 The RecipientLimitInternalPerHour parameter specifies the maximum number of internal recipients that a user can send to within an hour. A valid value is 0 to 10000. The default value is 0, which means the service...
-RecipientLimitPerDay UInt32 The RecipientLimitInternalPerHour parameter specifies the maximum number of recipients that a user can send to within a day. A valid value is 0 to 10000. The default value is 0, which means the service defaults are...
-RecommendedPolicyType RecommendedPolicyType The RecommendedPolicyType parameter is used for Standard and Strict policy creation as part of [Preset security policies](https://learn.microsoft.com/defender-office-365/preset-security-policies). Don't use this...

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