TMA-M365-REMOTE-DOMAIN-FORWARD
Ensure automatic forwarding is disabled on the default remote domain
MediumLevel 2Automatedm365
Description
The Default remote domain AutoForwardEnabled setting is a second layer that stops auto-forwarded and auto-replied mail leaving the organization. Requires an already-connected Exchange Online session: Install-Module ExchangeOnlineManagement; Connect-ExchangeOnline (View-Only Organization Management is sufficient). The audit throws if no session exists.
How it is checked
Audit method: Shell command
shell
$ErrorActionPreference = 'Stop'; if (-not (Get-Command Get-ConnectionInformation -ErrorAction SilentlyContinue) -or -not (Get-ConnectionInformation)) { throw 'Not connected: run Connect-ExchangeOnline first' }; $d = Get-RemoteDomain -Identity Default -ErrorAction Stop; if ($d.AutoForwardEnabled -eq $false) { 'compliant' } else { 'noncompliant' }- Expected output
compliant
How it is fixed
Fix method: Guidance or infrastructure patch
Set-RemoteDomain -Identity Default -AutoForwardEnabled $false
Properties
- Operating systems
- Any
- Tags
- m365mail-flow
- Reference
- CIS Microsoft 365 Foundations Benchmark v7.0.0 - Exchange Online / Remote domains - automatic forwarding (verify section number for your release)
Check this host
Run this on a machine you are allowed to audit. The scan is read-only.
shell
tmaegis scan --target m365 --level 2