Microsoft 365 tenant · Exchange Online, Defender for Office 365 & mail DNS

Disable Exchange Web Services, or restrict it to approved applications

When it fails: Exchange Web Services is open to every application. Any client or tool, including attacker tooling with stolen credentials or tokens, can read and export mailboxes through EWS.

CB-M365-MAIL-011mediumactivemanualprofile baseline

Description

Exchange Web Services (EWS) is turned off for the organization (EwsEnabled $false). When an application still needs EWS until it is migrated to Microsoft Graph, EWS stays on only for that application: EwsApplicationAccessPolicy is set to EnforceAllowList and EwsAllowList lists its user agent, or EWS is enabled on the single mailboxes concerned (Set-CASMailbox -EwsEnabled).

Microsoft is retiring EWS in Exchange Online: it disables EWS progressively from 1 October 2026 in tenants where administrators took no action, and removes it completely on 1 April 2027. After that date the control no longer applies.

Rationale

EWS is an old, broad API that gives full mailbox access and is widely used by mailbox export and search tools, including the ones attackers use after taking over an account or an application. Turning it off before the retirement removes an exfiltration path and shows which applications still depend on it, while there is time to migrate them.

Impact

Applications that still use EWS stop working: older Outlook for Mac versions, some third-party backup, archiving, CRM, scheduling or migration tools, and custom scripts. Inventory them with vendors and through the application sign-ins to Office 365 Exchange Online before the change, and plan their move to Microsoft Graph.

Audit

  1. There is no portal page for this setting. Connect to Exchange Online PowerShell as at least a Global Reader.
  2. Run (read-only):
    Get-OrganizationConfig | Format-List EwsEnabled, EwsApplicationAccessPolicy, EwsAllowList, EwsBlockList
    Get-CASMailbox -ResultSize Unlimited -Filter "EwsEnabled -eq $true" | Format-Table PrimarySmtpAddress, EwsEnabled
    
  3. Pass if EwsEnabled is False, or if EwsApplicationAccessPolicy is EnforceAllowList with a short, documented EwsAllowList.
  4. Fail if EwsEnabled is True or empty with no allow list, or if the allow list contains a wildcard that matches any client.

Remediation

  1. List the applications that still use EWS and their owners, and agree on a migration date.
  2. Connect to Exchange Online PowerShell as an Exchange Administrator.
  3. If no application needs EWS:
    Set-OrganizationConfig -EwsEnabled $false
    
  4. Otherwise, restrict it to the remaining applications:
    Set-OrganizationConfig -EwsApplicationAccessPolicy EnforceAllowList -EwsAllowList "<user agent 1>","<user agent 2>"
    
    or keep EWS off for the organization and enable it on the mailboxes that need it (Set-CASMailbox -Identity <mailbox> -EwsEnabled $true).

Rollback

Set-OrganizationConfig -EwsEnabled $true until 1 April 2027.

References

Mappings

FrameworkIDRelation
NIST SP 800-53 Rev. 55.1.1CM-7related
NIST SP 800-53 Rev. 55.1.1AC-3related

How this control relates to the other framework's: equivalent, stricter, looser, partial or related.

Threats mitigated

  • related CB-M365-MAIL-006 Keep modern authentication enabled for Exchange Online
  • related CB-M365-MAIL-037 Scope application access to mailboxes with RBAC for Applications
  • related CB-M365-AUTH-001 Block legacy authentication with Conditional Access

People and lifecycle

Authors
Introduced inv0.1.0
Created, updated2026-10-24, 2026-10-24
Translationsfr