Exchange Web Services (EWS) is a Microsoft API used by Lightning Sync to communicate with Microsoft Exchange servers. Lightning Sync is a legacy Salesforce feature — now replaced by Einstein Activity Capture — that synchronized contacts and calendar events between Salesforce and Microsoft Exchange or Office 365.
Some customers may experience Lightning Sync service account authentication failures where the service account cannot connect. To debug this issue, customers may need to run the EWS Utility in their environment and share the diagnostic results with Salesforce Support.
Prerequisite: To run the EWS Utility, the latest Java Runtime Environment (JRE) must be installed on your machine (PC or Mac). Java is a free software platform required to run Java-based tools. You can verify your Java version by typing java -version at the Command Prompt or Terminal.
Send the EWS Utility download link (available at the bottom of this article) to the customer and have them follow the steps below.
Step 1 — Create a working directory
Create a new folder on the computer, for example: C:\ExchangeSyncLogs (Windows) or ~/ExchangeSyncLogs (Mac).
Step 2 — Download and extract the EWS Utility
Download and extract the EWS Utility to the new folder created in Step 1.
Step 3 — Open Command Prompt as Administrator
Click Start, type CMD, right-click cmd.exe, and select Run as administrator.
Step 4 — Navigate to the working directory
In Command Prompt, type CD \ExchangeSyncLogs and press Enter.
Step 5 — Run the diagnostic command
The following command runs the EWS diagnostic utility. It uses Java to execute the EWSTest JAR file (a self-contained Java application). Replace the placeholder values with your actual credentials before running:java -cp ./EWSTest-0.9.222-1-jar-with-dependencies.jar test.exchange.AutoDiscoveryTest -username serviceAccount@domain.com -passwd password -impUsername targetMailbox@domain.com > testResults.txt 2>&1
Replace parameters as follows:
-username — Your Exchange service account email address-passwd — Your service account password-impUsername — The target mailbox email address you are testing impersonation forStep 6 — Retrieve the log file
The command generates a log file saved as testResults.txt in C:\ExchangeSyncLogs. Please allow a few minutes for the command to complete.
Step 7 — Share results with Salesforce Support
Provide the testResults.txt file and the command you used. Important: Replace your actual password in the command with a placeholder such as xxxx before sharing.
Notes:
000387671

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.