
Exchange Web Services (EWS) has long been used by applications to access mailboxes, calendars, and contacts in Microsoft Exchange. In Office 365, now known as Microsoft 365, EWS runs within Exchange Online. Many organizations still have tools that depend on it, such as calendar sync platforms, archiving solutions, CRM connectors, and migration utilities. Enabling EWS in Office 365 is different from on-premises Exchange. There is no IIS to configure, authentication must use OAuth, and Microsoft is actively retiring EWS in Exchange Online in favor of Microsoft Graph. This guide explains how to enable and configure EWS in Office 365 and how to plan for what comes next.
Modern Integration Development with AAMAX.CO
Building integrations with Microsoft 365 requires up-to-date knowledge of authentication, permissions, and APIs. AAMAX.CO is a full-service digital marketing company that provides web development, digital marketing, and SEO services worldwide. They develop secure business applications and portals that integrate with modern cloud services. If your organization needs to migrate legacy EWS integrations or build new tools on Microsoft Graph, their web application development team can create solutions that are secure, maintainable, and future-ready.
Important: The EWS Retirement in Exchange Online
Microsoft announced that EWS in Exchange Online is being retired, with blocking of EWS requests scheduled to begin on October 1, 2026. This change applies to Exchange Online, not to on-premises Exchange Server. Because timelines and exceptions can evolve, check the Microsoft 365 message center and the Exchange team blog for the current status for your tenant. If you are enabling EWS today, treat it as a temporary bridge while you migrate applications to Microsoft Graph.
Step 1: Connect to Exchange Online PowerShell
EWS settings in Office 365 are managed through Exchange Online PowerShell. Install the ExchangeOnlineManagement module with Install-Module ExchangeOnlineManagement, then connect with Connect-ExchangeOnline -UserPrincipalName admin@yourdomain.com. You will need an administrator account with appropriate Exchange permissions.
Step 2: Check Organization-Level EWS Status
Run Get-OrganizationConfig | Format-List EwsEnabled. If the result is False, EWS is disabled for the tenant. To enable it, run Set-OrganizationConfig -EwsEnabled $true. A null value typically means EWS has not been explicitly restricted at the organization level, although retirement policies may still apply.
Step 3: Check Mailbox-Level EWS Status
Individual mailboxes can have EWS disabled. Use Get-CASMailbox -Identity user@yourdomain.com | Format-List EwsEnabled to check. Enable it with Set-CASMailbox -Identity user@yourdomain.com -EwsEnabled $true. For service accounts or shared mailboxes used by applications, verify these settings specifically.
Step 4: Review Application Access Policies
Exchange Online supports allow lists and block lists for EWS clients through the EwsApplicationAccessPolicy, EwsAllowList, and EwsBlockList settings at both the organization and mailbox levels. If an application is being rejected, check whether its user agent is blocked or missing from an enforced allow list.
Step 5: Register an Application in Microsoft Entra ID
Basic authentication for EWS in Exchange Online has been retired, so applications must use OAuth 2.0. Sign in to the Microsoft Entra admin center, go to App registrations, and create a new registration. Then configure API permissions for Office 365 Exchange Online:
- Delegated permission EWS.AccessAsUser.All: Allows the app to access mailboxes as the signed-in user.
- Application permission full_access_as_app: Allows a background service to access mailboxes without a signed-in user.
An administrator must grant consent for these permissions. Create a client secret or, preferably, upload a certificate for the application to authenticate. Configure the application to request tokens for the Exchange Online resource.
Step 6: Restrict Application Access
Application permissions like full_access_as_app grant access to every mailbox in the tenant by default. Limit this using Exchange Online's role-based access control for applications or application access policies, which can scope access to specific mailboxes or groups. This step is essential for security and compliance.
Step 7: Configure Impersonation if Needed
Some EWS applications use impersonation, where a service account acts on behalf of other users. Assign the ApplicationImpersonation role carefully and only to required accounts, using management scopes to limit which mailboxes can be accessed. Note that Microsoft has been deprecating this role in Exchange Online in favor of application permissions with RBAC, so verify current guidance before relying on it.
Step 8: Test the Connection
The Exchange Online EWS endpoint is https://outlook.office365.com/EWS/Exchange.asmx. Test your application's connection using its built-in diagnostics, or use the Microsoft Remote Connectivity Analyzer. Errors related to tokens usually indicate missing permissions, lack of admin consent, or incorrect token audiences.
Migrating to Microsoft Graph
Microsoft Graph provides a modern REST API for mail, calendars, contacts, and much more across Microsoft 365. It supports fine-grained permissions, webhooks for change notifications, and better performance. Inventory every application in your tenant that uses EWS, contact vendors about Graph support, and plan custom application rewrites early. Sign-in and audit logs in Microsoft Entra ID can help you identify active EWS usage.
Security Best Practices
- Use certificate-based authentication for applications instead of client secrets.
- Scope application access to specific mailboxes.
- Enable EWS only for users and apps that require it.
- Review consented applications and permissions regularly.
- Monitor audit logs for unusual mailbox access.
Conclusion
Enabling Exchange Web Services in Office 365 involves checking organization and mailbox settings in Exchange Online PowerShell, configuring OAuth through Microsoft Entra ID, and tightly scoping application access. Because EWS in Exchange Online is being retired, use it only as a short-term solution and prioritize migration to Microsoft Graph. With careful configuration and a forward-looking plan, your integrations can remain secure and functional through the transition.
