Connect to Exchange Server (on-premises)

Note

Effective November 2020:

  • Common Data Service has been renamed to Microsoft Dataverse. Learn more
  • Some terminology in Microsoft Dataverse has been updated. For example, entity is now table and field is now column. Learn more

This article will be updated soon to reflect the latest terminology.

With version 9.0., you can connect your customer engagement apps (Dynamics 365 Sales, Dynamics 365 Customer Service, Dynamics 365 Field Service, Dynamics 365 Marketing, and Dynamics 365 Project Service Automation), with Microsoft Exchange Server (on-premises).

Check out the following white paper: Setup Guide: Server-side synchronization for CRM Online and Exchange Server

Prerequisites

  1. Exchange Server. The following versions are supported: Exchange Server 2013 SP1, Exchange Server 2016, or Exchange Server 2019.

  2. Authentication. During installation, Exchange configures Internet Information Services (IIS). To connect customer engagement apps with Exchange Server, Windows (NTLM) or Basic authentication must be enabled in Exchange Server. When configuring Windows (NTLM) authentication, make sure Basic authentication is disabled on Exchange server.

    For more information on authentication, see:

  3. ApplicationImpersonation role. You need to create and configure a service account with the ApplicationImpersonation role in Microsoft Exchange. More information: Impersonation and EWS in Exchange.

  4. Secured connection. The connection between customer engagement apps and Exchange must be encrypted via TLS/SSL and current cipher suites.

  5. Exchange Web Services (EWS). Connections to EWS must be allowed through the firewall. Often a reverse proxy is used for the exterior facing connection.

Tip

To make sure you've got a good connection to Exchange on-premises run the Microsoft Remote Connectivity Analyzer. For information on what tests to run, see Test mail flow with the Remote Connectivity Analyzer.

Create an email server profile

  1. In the Power Platform admin center, select an environment.

  2. Select Settings > Email > Server profiles.

  3. Select New > Exchange Server (Hybrid).

  4. For an Exchange email server profile, specify the following details:

    Fields Description
    General
    Name Specify a meaningful name for the profile.
    Description Type a short description about the objective of the email server profile.
    Auto Discover Server Location Select Yes (recommended), if you want to use the automatically discover service to determine the server location. If you set this to No, you must specify the email server location manually.
    Incoming Server Location and Outgoing Server Location If you select No in Auto Discover Server Location, enter a URL for Incoming Server Location and Outgoing Server Location.
    Credentials
    Authenticate Using Impersonation Enter the credentials for the Exchange service account granted the ApplicationImpersonation role.
    User Name Type the user name for the Exchange service account.
    Password Type the password for the Exchange service account.
    Advanced
    Additional Settings
    Process Email From Select a date and time. Email received after the date and time will be processed by server-side synchronization for all mailboxes associated with this profile. If you set a value less than the current date, the change will be applied to all newly associated mailboxes and their earlier processed emails will be pulled.
    Minimum Polling Intervals in Minutes Type the minimum polling interval, in minutes, for mailboxes that are associated with this email server profile. The polling interval determines how often server-side synchronization polls your mailboxes for new email messages.
    Maximum Concurrent Connections Type the maximum number of simultaneous connections that can be made by customer engagement apps to the corresponding email server per mailbox. Increase the value to allow more parallel calls to Exchange to improve performance or reduce the value if there are errors on Exchange due to large number of calls from customer engagement apps. The default value of this field is 10. The maximum number is considered per mailbox or per email server profile depending on whether the credentials are specified in a mailbox or email server profile.
    Move Failed Emails to Undeliverable Folder To move the undelivered email to the Undeliverable folder, select Yes. If there's an error in tracking email messages in Dynamics 365 apps as email activities, and if this option is set to Yes, the email message will be moved to the Undeliverable folder.
    Email Notifications
    Send an alert email to the owner of the email server profile reporting on major events If you want the email server profile owner to be notified when more than 50% of the mailboxes fail, select Yes.
  5. Select Save.

  6. Select Test Connection and review the results. To diagnose issues, see the following section.

Troubleshooting the Exchange Server (Hybrid) profile connection

If you've run Test Connection and have issues with the Exchange Server (Hybrid) profile connection, use the information in the Test Connection dialog box to diagnose and fix the connection.

Review the error messages

In this case, there's a problem with Auto Discover. The admin should review the user name and password used for Authentication Using Impersonation for the Exchange Server (Hybrid) profile.

You can find information on recurring issues and other troubleshooting information in Blog: Test and Enable Mailboxes in Microsoft Dynamics CRM 2015 and Troubleshooting and monitoring server-side synchronization.

Configure default email processing and synchronization

Set server-side synchronization to be the default configuration method.

  1. In the Power Platform admin center, select an environment.

  2. Select Settings > Email > Email settings.

  3. Under Synchronization methods, set the processing and synchronization fields as follows:

    • Server Profile: The profile you created in the above section.

    • Incoming Email: Server-Side Synchronization or Email Router

    • Outgoing Email: Server-Side Synchronization or Email Router

    • Appointments, Contacts, and Tasks: Server-Side Synchronization or Email Router

      If you leave the Email processing form unapproved user and queues at the default values (checked), you will need to approve emails and queues for user mailboxes as directed below in Approve Email.

  4. Select Save.

Configure mailboxes

To set mailboxes to use the default profile, you must first set the Server Profile and the delivery method for email, appointments, contacts, and tasks.

In addition to administrator permissions, you must have Read and Write privileges on the Mailbox entity to set the delivery method for the mailbox.

Select one of the following methods:

Set mailboxes to the default profile

  1. In the web app, go to Settings > Email Configuration > Mailboxes.

  2. Select Active Mailboxes.

  3. Select all the mailboxes that you want to associate with the Exchange Server profile you created, select Apply Default Email Settings, verify the settings, and then select OK.

    Apply default email settings

    By default, the mailbox configuration is tested and the mailboxes are enabled when you select OK.

Edit mailboxes to set the profile and delivery methods

  1. In the web app, go to Settings > Email Configuration > Mailboxes.

  2. Select Active Mailboxes.

  3. Select the mailboxes that you want to configure, and then select Edit.

  4. In the Change Multiple Records form, under Synchronization Method, set Server Profile to the Exchange Server profile you created earlier.

  5. Set Incoming and Outgoing Email to Server-Side Synchronization or Email Router.

  6. Set Appointments, Contacts, and Tasks to Server-Side Synchronization.

  7. Select Change.

Approve email

You need to approve each user mailbox or queue before that mailbox can process email.

  1. In the web app, go to Settings > Email Configuration > Mailboxes.

  2. Select Active Mailboxes.

  3. Select the mailboxes that you want to approve, and then select More Commands () > Approve Email.

  4. Select OK.

Test configuration of mailboxes

  1. Go to Settings > Email Configuration > Mailboxes.

  2. Select Active Mailboxes.

  3. Select the mailboxes you want to test, and then select Test & Enable Mailboxes.

    This tests the incoming and outgoing email configuration of the selected mailboxes and enables them for email processing. If an error occurs in a mailbox, an alert is shown on the Alerts wall of the mailbox and the profile owner. Depending on the nature of the error, customer engagement apps try to process the email again after some time or disables the mailbox for email processing.

    The result of the email configuration test is displayed in the Incoming Email Status, Outgoing Email Status, and Appointments, Contacts, and Tasks Status fields of a mailbox record. An alert is also generated when the configuration is successfully completed for a mailbox. This alert is shown to the mailbox owner.

Tip

If you're unable to synchronize contacts, appointments, and tasks for a mailbox, you may want to select the Sync items with Exchange from this org only, even if Exchange was set to sync with a different org check box. Read more about this check box.

Test email configuration for all mailboxes associated with an email server profile

  1. In the Power Platform admin center, select an environment.

  2. Select Settings > Email > Server profiles.

  3. Select the profile you created, and then select Test & Enable Mailboxes.

    When you test the email configuration, an asynchronous job runs in the background. It may take a few minutes for the test to be completed. Customer engagement apps test the email configuration of all the mailboxes associated with the Exchange Server profile. For the mailboxes configured with server-side synchronization for synchronizing appointments, tasks, and contacts, it also checks to make sure they're configured properly.

Tip

If you're unable to synchronize contacts, appointments, and tasks for a mailbox, you may want to select the Sync items with Exchange from this org only, even if Exchange was set to sync with a different org check box. Read more about this check box.

See also

Troubleshooting and monitoring server-side synchronization
Test mail flow with the Remote Connectivity Analyzer
Server-side synchronization
Autodiscover service
Managing the Autodiscover Service