Commands › Exchange Online

Set-RecipientFilterConfig

Exchange Online ExchangeOnlineManagement Set-*

Enable and configure the Recipient Filter agent.

Quick start script

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

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

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

Syntax

Set-RecipientFilterConfig [-BlockedRecipients <MultiValuedProperty>]
 [-BlockListEnabled <Boolean>]
 [-Confirm]
 [-DomainController <Fqdn>]
 [-Enabled <Boolean>]
 [-ExternalMailEnabled <Boolean>]
 [-InternalMailEnabled <Boolean>]
 [-RecipientValidationEnabled <Boolean>]
 [-WhatIf]
 [<CommonParameters>]

Parameters (9)

ParameterTypeRequiredWhat it controls
-BlockedRecipients MultiValuedProperty The BlockedRecipients parameter specifies one or more SMTP addresses. To enter multiple SMTP addresses, separate the addresses by using a comma. The maximum number of individual SMTP addresses that you can input is 800.
-BlockListEnabled Boolean The BlockListEnabled parameter specifies whether the Recipient Filter agent blocks messages sent to recipients listed in the BlockedRecipients parameter. Valid input for the BlockListEnabled parameter is $true or...
-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 specifies whether the Recipient Filter agent is enabled on the computer on which you're running the command. Valid input for the Enabled parameter is $true or $false. The default setting is...
-ExternalMailEnabled Boolean The ExternalMailEnabled parameter specifies whether all messages received from unauthenticated connections by servers external to your organization are passed through the Recipient Filter agent for processing. Valid...
-InternalMailEnabled Boolean The InternalMailEnabled parameter specifies whether all messages from authenticated sender domains that belong to authoritative domains in the enterprise are passed through the Recipient Filter agent for processing....
-RecipientValidationEnabled Boolean The RecipientValidationEnabled parameter specifies whether the Recipient Filter agent blocks messages addressed to recipients that don't exist in the organization. Valid input for the RecipientValidationEnabled...
-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.