Можно установить антиспам агенты полностью с помощью скрипта Install-AntiSpamAgents.ps1, но они установятся только для Hub коннектора. Если посмотреть содержимое скрипта, то там -TransportService HUB
Для FrontEnd можно установить агенты отдельно, используя -TransportService
1. Установка антиспам агентов
& $env:ExchangeInstallPath\Scripts\Install-AntiSpamAgents.ps1
Install-TransportAgent -Name "Recipient Filter Agent" -TransportService FrontEnd -TransportAgentFactory "Microsoft.Exchange.Transport.Agent.ProtocolFilter.RecipientFilterAgentFactory" -AssemblyPath "C:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\agents\Hygiene\Microsoft.Exchange.Transport.Agent.Hygiene.dll" Install-TransportAgent -Name "Connection Filtering Agent" -TransportService FrontEnd -TransportAgentFactory "Microsoft.Exchange.Transport.Agent.ConnectionFiltering.ConnectionFilteringAgentFactory" -AssemblyPath "C:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\agents\Hygiene\Microsoft.Exchange.Transport.Agent.Hygiene.dll"
Чтобы посмотреть установленного агента, нужно указывать конкретно
Get-TransportAgent -TransportService FrontEnd | fl *
По умолчанию показывает только для Hub
2. Включение Recipient агента
Get-ReceiveConnector | fl name,bindings Get-RecipientFilterConfig | FL Enabled,RecipientValidationEnabled Get-AcceptedDomain | Format-List Name,AddressBookEnabled Set-RecipientFilterConfig -RecipientValidationEnabled $true Restart-Service MSExchangeTransport
С какого-то сервиспака по умолчанию работает только на HubTransport, но не на FrontEndTransport
Set-RecipientFilterConfig -BlockListEnabled $true -BlockedRecipients batman@exchlab.ru
После какого-то CU работает только на Hub, а не на FrontEnd
(Get-ReceiveConnector)[0] | Get-ADPermission -user "NT AUTHORITY\Anonymous Logon" | where {$_.ExtendedRights -like "ms-exch-smtp-accept-authoritative-domain-sender"} | Remove-ADPermission
После ввода . выйдет предупреждение
550 5.7.60 SMTP; Client does not have permissions to send as this sender