How to Fix PowerShell EWS Calendar Import Error 503
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.

- 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.
Ensure you have administrative access to the Exchange environment and verify that the target Exchange server is currently online and operational.
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.
Log into the Microsoft Entra admin center, navigate to App registrations, and create a new registration to obtain a Client ID and Tenant ID.
In your app registration, go to API permissions, add a permission, select 'Exchange', and grant the 'EWS.AccessAsUser.All' delegated permission.
Modify your script to acquire an OAuth token using the Microsoft Authentication Library (MSAL) module before connecting.
Assign the retrieved OAuth token to the 'Credentials' object of your EWS Managed API 'ExchangeService' instance.

Review Exchange Throttling Policies
Exchange may temporarily block requests with a 503 error if your script exceeds the allowed EWS connection or request limits.
Verify Server Status and EWS URL
Ensure the Exchange server is functioning normally and the script is targeting the correct EWS endpoint.
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. Download the software: Visit the official WPS website and download the free installation package for your operating system.
- 2. Install and launch: Run the installer and open WPS Office to access Writer, Spreadsheet, Presentation, and PDF tools in one window.
- 3. Open your files: Drag and drop your existing Microsoft Office files into WPS to start editing immediately with full format compatibility.

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.




