Download file: Exchange Correction.zip
Applies to
-
Sage CRM 2023 R2.4 onwards
-
Sage CRM 2024 R2.1 onwards
-
Sage CRM 2025 R1
-
Sage CRM 2025 R2
Earlier supported versions of Sage CRM that fall below the versions listed above are not covered by this workaround. Customers running earlier releases should review upgrade options to a supported version where the workaround is applicable.
Summary
Some customers using the Exchange Online integration may experience failures connecting to the Exchange Sync Engine. This has been traced to a malformed URL in XML headers used by the Exchange Sync Engine, which is now being rejected following changes in Microsoft Exchange Online validation behaviour.
This workaround updates the affected XML configuration files used by the Exchange Sync Engine to correct the malformed URL.
What this workaround changes
This workaround updates specific XML configuration files used by the Exchange Sync Engine:
-
hibernate.cfg.xml -
*.hbm.xml
The PowerShell script corrects legacy or malformed DTD URLs in these files so that they conform to formats now accepted by Exchange Online.
For safety, the script automatically creates a .bak backup of every file it modifies.
No Sage CRM application data is changed.
Prerequisites
-
Administrative access to the Sage CRM server
-
Ability to stop and start the Tomcat service used by the Exchange Sync Engine
-
PowerShell access on the server
Workaround steps
1. Save the script
Download and unzip the file above. Copy the file ExchangeCorrection.ps1 to the Sage CRM server, for example:
C:\Temp\ExchangeCorrection.ps1
2. Edit the script
Open ExchangeCorrection.ps1 in a text editor and locate the $root value near the top of the file.
Update it to point to your Exchange Sync Engine installation directory.
Format:
[InstallPath]\tomcat\webapps\crmExchangeSyncEngine
Example:
C:\Program Files (x86)\Sage\CRM\CRM\tomcat\webapps\crmExchangeSyncEngine
Where:
-
[InstallPath]is the Sage CRM installation path
Save the file after editing.
3. Stop the Exchange Sync Engine service
Stop the Tomcat service used by the Exchange Sync Engine.
4. Run the script
Open a Command Prompt or PowerShell window as Administrator and run:
powershell -ExecutionPolicy Bypass -File C:\Temp\ExchangeCorrection.ps1
The script will update the relevant XML files and create .bak backups where changes are made.
5. Clear the Tomcat work directory
Delete the contents of the following directory:
..\tomcat\work\Catalina\
This ensures Tomcat recompiles cached configuration and XML files.
6. Restart the Exchange Sync Engine service
Restart the Tomcat service used by the Exchange Sync Engine.
Validation
After restarting the service:
-
Open Sage CRM
-
Validate that the Exchange integration reconnects successfully
-
Confirm that synchronization resumes as expected
Rollback instructions
If you need to revert this workaround:
-
Stop the Tomcat service used by the Exchange Sync Engine
-
Restore the original files by replacing any modified XML file with its corresponding
.bakfile -
Clear the
..\tomcat\work\Catalina\directory -
Restart the Tomcat service
This returns the system to its pre-workaround state.
Important notes
-
This workaround is supported only for Sage CRM 2023 R2.4 onwards, 2024 R2.1 onwards, 2025 R1 and 2025 R2.
-
This workaround does not affect OAuth2-based import of Contacts and Emails.
