Dynamics CRM Online – Exchange Online – Server Side Sync with Custom Domain Workaround

Disclaimer: this workaround is categorised as unsupported by Microsoft as described in the following Best Practice article: https://technet.microsoft.com/en-gb/library/dn887218.aspx

Recently I just configured a Dynamics CRM Online to Exchange Online that has custom domain. It was a straight forward process for environment that is using “onmicrosoft.com” domain as their username and email address. However, in most of real cases, it should not use onmicrosoft.com domain for production environment, as it does not reflect the branding and ownership of the company. Most of the customers will use their own domain, e.g: emailaddress@contoso.com.

For this implementation I have followed through the regular guide on approving the mailbox as described in: https://technet.microsoft.com/en-us/library/dn832109.aspx. However as the email address is using the customer’s domain name, I always encounter an error during the “Test and Enable” the mailbox: The mailbox location could not be determined while sending/receiving the email message <Message Subject>. The mailbox <Mailbox Name> has been disabled for sending/receiving email and the owner of the associated email server profile <Email Server Profile name> has been notified.

That error message is listed up on the troubleshooting guide on: https://technet.microsoft.com/en-us/library/dn850386.aspx. The resolution for this error is: “You will see this alert if your email server profile (Settings > Email Configuration > Email Server Profiles) is configured to use the Auto Discover Server Location option but auto discover cannot detect the location of your mailbox. If this issue occurs, check with your Exchange administrator to verify your network is configured for auto discover. You can update the email server profile and choose No for Auto Discover Server Location. Then provide the Exchange web services URL for your Exchange deployment.”

Now, for Dynamics CRM Online, it seems Microsoft have applied a different script/css to hide the Auto Discover Server Location settings. As a workaround I need to do some HTML hack to bring back the elements to be editable.

Now it’s the step by step guide:

  1. Open the Exchange Online email server profile from Settings > Email Configuration > Email Server Profiles.
  2. Using browser’s developer tool (in my example, I’m using IE, but it’s up to you to use your favorite browser). Find the auto discover element: with id useautodiscover_c and useautodiscover_d, remove the style tag that hide the element:
    AutoDiscover.png
  3. Now the Auto Discover Option should be visible, but they are in disabled state. So, we need to remove the disabled tag on the following element: div with id: useautodiscover and and input radio button with name: rad_useautodiscover.AutoDiscover2.pngAutoDiscover3.png
  4. Now you should have the Auto Discover Server Location tag to be editable, set it to No.
    AutoDiscoverEditable.png
  5. Then the next part is to make Incoming and Outgoing Server location to be editable and set the exchange online web service address: https://outlook.office365.com/EWS/Exchange.asmx. To make the fields editable, find the following elements: input with id: incomingserverlocation and outgoingserverlocation. 
    Incoming.png
    Outgoing.png
  6. Now you should have the fields editable:
    Editable.png
  7. Once you’ve specified the above configuration, save and close the Email Server Profile for Exchange Online. Then go back to the mailbox and run again the “Test and Enable” process. You should have the server side sync worked.

HTH!

One thought on “Dynamics CRM Online – Exchange Online – Server Side Sync with Custom Domain Workaround

  1. by doing this status is changed to success but no test mails received but shows test message sent successfully in alerts of mail box

Leave a comment