Exchange Connection Problems

How to Fix PowerShell EWS Calendar Import Error 503

Kushani NimanthikaKushani Nimanthika Oct 29, 2026 868 views

Question details

The user needs to resolve a 503 Server Unavailable error encountered while running an Exchange Web Services (EWS) PowerShell script to import calendar data.

How to Fix PowerShell EWS Calendar Import Error 503
Product
Microsoft Exchange
Device & OS
not provided
Scenario
Running a PowerShell script to import calendars via Exchange Web Services (EWS).
Observed behavior
The script fails with a '503 Server Unavailable' error, indicating potential outages, throttling, or retired basic authentication.
Before you start

Ensure you have administrative access to the Exchange environment and verify that the target Exchange server is currently online and operational.

Solution 1Recommended

Migrate to Modern Authentication (OAuth)

Microsoft has retired Basic Authentication for EWS. Updating your script to use OAuth is the most common fix for recent 503 errors.

If your PowerShell script relies on a standard username and password (Basic Authentication), Exchange Online will actively block the connection, often resulting in a 503 Server Unavailable or 401 Unauthorized error.

1
Register your application

Log into the Microsoft Entra admin center, navigate to App registrations, and create a new registration to obtain a Client ID and Tenant ID.

2
Grant API permissions

In your app registration, go to API permissions, add a permission, select 'Exchange', and grant the 'EWS.AccessAsUser.All' delegated permission.

3
Update PowerShell script

Modify your script to acquire an OAuth token using the Microsoft Authentication Library (MSAL) module before connecting.

4
Inject the OAuth token

Assign the retrieved OAuth token to the 'Credentials' object of your EWS Managed API 'ExchangeService' instance.

Migrate to Modern Authentication (OAuth)
Module Requirement: You may need to install the 'MSAL.PS' or equivalent PowerShell module to easily handle the OAuth 2.0 token acquisition process.
Free Microsoft Office alternative

Looking for a reliable office suite? Try WPS Office

If you frequently manage complex schedules, data, and reports outside of Exchange, WPS Office provides a lightweight, highly compatible, and free alternative to Microsoft Office for your daily productivity needs.

  1. 1. Download the software: Visit the official WPS website and download the free installation package for your operating system.
  2. 2. Install and launch: Run the installer and open WPS Office to access Writer, Spreadsheet, Presentation, and PDF tools in one window.
  3. 3. Open your files: Drag and drop your existing Microsoft Office files into WPS to start editing immediately with full format compatibility.
Fully compatible with Microsoft Word, Excel, and PowerPoint formats.Lightweight design ensures fast launch times and smooth performance.Familiar, tabbed user interface requires no learning curve.Built-in PDF toolkit for easy document conversion and editing.
microsoft office alternative - wps office

Frequently Asked Questions

Why did my EWS script suddenly start throwing Error 503?

Microsoft has disabled Basic Authentication for Exchange Online. If your script relies on standard username and password credentials without modern OAuth implementation, EWS will reject the connection, often resulting in a 503 Server Unavailable or 401 Unauthorized error.

How do I know if EWS throttling is causing the 503 error?

If your script successfully imports a few calendar items and then begins to fail with a 503 error or a 'ServerBusyException', you are likely hitting EWS concurrency or burst limits. Adding a delay between requests can help confirm and mitigate this.

Is Exchange Web Services (EWS) being deprecated?

Yes, Microsoft has announced the deprecation of EWS for Exchange Online in favor of the Microsoft Graph API. It is highly recommended to migrate future calendar management and import scripts to Microsoft Graph.