Commands › Exchange Online

Set-SenderFilterConfig

Exchange Online ExchangeOnlineManagement Set-*

Modify the Sender Filter agent configuration.

Quick start script

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

# 3. Make the change (dry run first)
Set-SenderFilterConfig  -WhatIf
Set-SenderFilterConfig

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

Syntax

Set-SenderFilterConfig [-Action <BlockedSenderAction>]
 [-BlankSenderBlockingEnabled <Boolean>]
 [-BlockedDomains <MultiValuedProperty>]
 [-BlockedDomainsAndSubdomains <MultiValuedProperty>]
 [-BlockedSenders <MultiValuedProperty>]
 [-Confirm]
 [-DomainController <Fqdn>]
 [-Enabled <Boolean>]
 [-ExternalMailEnabled <Boolean>]
 [-InternalMailEnabled <Boolean>]
 [-RecipientBlockedSenderAction <RecipientBlockedSenderAction>]
 [-WhatIf]
 [<CommonParameters>]

Parameters (12)

ParameterTypeRequiredWhat it controls
-Action BlockedSenderAction The Action parameter specifies the action that the Sender Filter agent takes on messages from blocked senders or domains. Valid input for this parameter is StampStatus or Reject. The default value is Reject.
-BlankSenderBlockingEnabled Boolean The BlankSenderBlockingEnabled parameter blocks or allows messages that don't contain a sender value in the SMTP command MAIL FROM. Valid input for this parameter is $true or $false. The default value is $false.
-BlockedDomains MultiValuedProperty The BlockedDomains parameter specifies the domain names to block. When the Sender Filter agent encounters a message from a domain on this list, the Sender Filter agent takes the action specified by the Action parameter.
-BlockedDomainsAndSubdomains MultiValuedProperty The BlockedDomainsAndSubdomains parameter specifies the domain names to block. When the Sender Filter agent encounters a message from a domain on this list, or from any of the domain's subdomains, the Sender Filter...
-BlockedSenders MultiValuedProperty The BlockedSenders parameter specifies one or more SMTP email addresses to block. When the Sender Filter agent encounters a message from a sender on this list, the Sender Filter agent takes the action specified by...
-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.
-DomainController Fqdn The DomainController parameter specifies the domain controller that's used by this cmdlet to read data from or write data to Active Directory. You identify the domain controller by its fully qualified domain name...
-Enabled Boolean The Enabled parameter enables or disables sender filtering on your Exchange server. Valid input for this parameter is $true or $false. The default value is $true.
-ExternalMailEnabled Boolean The ExternalMailEnabled parameter enables or disables sender filtering on unauthenticated connections from external messaging servers. Valid input for this parameter is $true or $false. The default value is $true.
-InternalMailEnabled Boolean The InternalMailEnabled parameter enables or disables sender filtering on authenticated connections from authoritative domains in your organization. Valid input for this parameter is $true or $false. The default...
-RecipientBlockedSenderAction RecipientBlockedSenderAction The RecipientBlockedSenderAction parameter specifies the action that the Sender Filter agent takes on messages received from blocked senders that are defined by SafeList aggregation. SafeList aggregation adds blocked...
-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.

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