How to Set Microsoft Exchange Online Service Account Permissions for use with Server Side Sync or Email Router

If you're using Microsoft Exchange Online and you're setting up a server side sync or email router, you may be using the method of using one service account in your Exchange environment to use in the configuration of the email router or server side sync. This one service account would then be used for access to all other user mailboxes. In today's blog, however, we'll show you how to set permissions for an Exchange online service account for use with server side sync or email router. So let's dive in!

This steps outlined below are accomplishing this using PowerShell. Most of these steps can also be done via the web user interface of Office 365, but it's easier to automate the permissions on a large number of mailboxes with PowerShell.

1. First, connect to your Office 365 tenant via PowerShell.

2. Next, run PowerShell using the following commands to connect to your Office 365. When prompted, log in with an account that's a global administrator in your Office 365 tenant:

Import-Module MSOnline
$O365Cred = Get-Credential
$O365Session = New-PSSession –ConfigurationName Microsoft.Exchange -ConnectionUri -Credential $O365Cred -Authentication Basic -AllowRedirection
Import-PSSession $O365Session
Connect-MsolService –Credential $O365Cred

3. Grant your service account the application impersonation role by running the following commands:

Note: This permission may sometimes take up to about an hour to take effect.

4. The service account will need "send as" permissions for any users that will be sending out emails from CRM through this setup as well as "full access" permissions for any users that will have incoming mail monitored by the email router or SSS (server side sync).

To grant "send as" permission for all existing mailboxes follow these steps:

Alternatively, if you wanted to apply permissions only to some users, simply create a text file of all the email addresses, one email address per line, and apply permissions with the commands below. First, create your text file with one email address per line and nothing else. Be sure that the email addresses are primary email address.

In this example, our file is called "emailaddresses.txt" and is saved in c:filelocation.

5. Run this command to import contents into a new variable we are calling $emails:

6. Next, to set "send as" permissions for the service account on all the mailboxes in the list follow these steps:

7. One optional step you may want is to have the password never expire for this service account (be sure to set a very strong password). This will prevent email processing from stopping when the service account's password expires. Through PowerShell, you can do this using the following command:

8. One final item to be aware of is that the "send as" and/or "full access" permissions were granted for existing mailboxes, but as new users get created in the future, the service account will need to have permissions added if the new users require incoming and/or outgoing email through CRM.

To grant these permissions for one user follow these steps:

That's all for the blog today. Want to learn more about Microsoft's wide array of services and products? Check out our information about Microsoft Office 365 and learn how you can bundle all of your cloud licenses and services by participating in our Microsoft Cloud by PowerObjects program!

Happy CRM'ing!

Manage or Sync Important Dates from CRM to Outlook

The activity and appointment sync from Microsoft Dynamics CRM to Outlook is a very powerful feature. Getting creative with this feature can help extend your CRM implementation to help the users keep track of important milestones in their sale or project.

In order to accomplish this, when a key date is entered on the project, we'll use workflow to create an outlook appointment that is synchronized to the users Outlook calendar. If the date changes in CRM, the date will reflect on the calendar.

In order to demonstrate how this solution, we'll use the example of a custom Project entity. However, this same concept could apply to Leads, Opportunities or anywhere else you could take advantage. The synchronization to Outlook requires users to have Microsoft Dynamics CRM for Outlook installed or Server Side Synchronization setup. Resources for both are below:

  1. How to install Microsoft Dynamics CRM for Outlook
  2. Server Side Synchronization

The steps to build the functionality are as follows:

Part 1 - Add date field and lookup to Appointment

In our scenario, the most important date on the project is the Expected Completion Date and may change over the course of the project. A lookup field to the Appointment will also be used by the workflow to reference if the date changes. To do this, follow these steps:

  1. Navigate to the Settings > Customizations area.
  2. On the Project entity form, add a new date field for the Expected Completion Date field.
  3. Add a new lookup field and select the entity Appointment.
  4. Publish your customizations.

Part 2 - Build a workflow to create or update the Appointment

Now that we have our two fields, we can build our workflow.

  1. Navigation to the Settings > Processes area.
  2. Create a new workflow using the Project entity.
  3. Make sure the workflow triggers when a Project record is created, or when Expected Complete Date changes.

    sync important dates img 1

  4. Add a new condition that the Completed Date contains data.
    sync important dates img 2 v2
  5. Add a second condition is to check if an Appointment record already exists (checking our new custom lookup field 'Expected Install Complete Appt'). If so, add a step to simply update the Appointment 'Start Date' with the new date.
    sync important dates img 3

    Conversely, if this is a new Project – we will create an appointment.

  6. Add a new condition to check if the expected Complete date does not contain data
  7. Add a step to create the Appointment. Make sure to click set Properties to fill out the necessary Appointment fields.

    sync important dates img 4

  8. Add an additional step to update the Project with a link to the Appointment.sync important dates img 5
    Your last steps will look like this.
    sync important dates img 6
  9. Lastly publish your workflow. Here is full view of the entire workflow.

sync important dates img 7

And here is what the appointment looks like once it syncs to Outlook.

sync important dates img 8

In some scenarios using this quick configuration can help your teams keep track of important upcoming dates.

Happy CRM'ing!

Managing Multiple Email Integration Systems

Managing and creating a multi-server deployment can be challenging when you start to look at all the roles you can associate to a server. When setting up a new deployment or working with an existing one it is always suggested to refer to the Microsoft Dynamics CRM Implementation Guide. The following suggestions should provide value on that next Server Side Sync hurdle.


With Server Side Sync configured you may come across pending send mail if you have multiple email integration services in the same deployment


One CPU tries to take on all the work an can create a backlog



1. Dedicate one backend server for mail processing

*this may not be an option where high availability is a concern*

2. Update the deployment properties table to throttle for better management

update MSCRM_CONFIG.dbo.DeploymentProperties set IntColumn =
where ColumnName =

update MSCRM_CONFIG.dbo.DeploymentProperties set IntColumn =
where ColumnName =

update MSCRM_CONFIG.dbo.DeploymentProperties set IntColumn =
where ColumnName =

update MSCRM_CONFIG.dbo.DeploymentProperties set IntColumn =
where ColumnName =

update MSCRM_CONFIG.dbo.DeploymentProperties set IntColumn =
where ColumnName =

*MailboxQueueSelectMaxItems start with 5 working your way down

**these adjustments are as/is and may need to be adjusted for your deployment


Happy CRM'ing!



Testing Incoming Mailbox Configuration for Server Side Sync

Here is a quick blog for those of you setting up server side sync in Dynamics CRM: If your Email Server Profile is set to "Credentials specified by a user or queue" as shown below:


Then the incoming "Email Configuration Test" for a mailbox does not check the credentials access to the email address specified. As long as the credentials entered have access to the Server specified in your Email Server Profile, the test will succeed, regardless of whether those credentials can open the mailbox, or if the mailbox even lives on this server.

In the example below, the email address is not valid (PowerObjects is misspelled) yet the Incoming Email Status shows "Succeeded".


Testing Incoming Mailbox Configuration for Server Side Sync


This is a good reminder to always double-check your email addresses and credentials when configuring or testing Server-Side Sync, even if your Configuration Test results are a success. If you are switching from an email router to server side sync in Dynamics CRM, click on the link for a super great and informative blog that will get you up and running! And as always, if you run into trouble, we are happy to help! You can reach out to us here.

Happy CRM'ing!

Switching from an Email Router to Server-Side Sync in Dynamics CRM 2013

If you haven't done so by now, you are probably considering upgrading to CRM 2013. CRM 2013 introduces the new Server-Side Synchronization (SSS) feature which can take the place of email router. Eliminating the email router also offers the benefit of further centralizing the administration of CRM toward the application layer. In this blog we will discuss how to migrate email router settings to Server-Side Sync.

You can configure SSS manually, but Microsoft also included a migration feature that makes the transition much easier and ensures that you are not missing any granular settings that may be in place for the Email Router. All you need to use the migration option is access to the CRM Email Router folder on the server where it is installed.

Before You Begin

A side note before we go on, if you have upgraded to 2013 you may be missing part of the site map that you need for the rest of this walk-through. Under Settings you should see an Email Configuration button to the right of Auditing.

Switching from an Email Router to Server-Side Sync in Dynamics CRM 2013

If you don't see this option, you can add this it with a simple sitemap edit. Find the following entry in the sitemap:

<SubArea Id="nav_audit" ResourceId="Audit_SubArea_Title" DescriptionResourceId="Audit_SubArea_Description" Icon="" Url="" AvailableOffline="false" />

Paste the following in to the sitemap after the above tag:

<SubArea Id="nav_social" ResourceId="Social_SubArea_Title" DescriptionResourceId="Social_SubArea_Description" Icon="" Url="" AvailableOffline="false" />

Migrating Email Router Settings

  1. On the server where the email router is installed, open an Internet Explorer Browser and navigate to CRM. Once there click Settings > Email Configuration (the button showcased above). Then click the Migrate Email Router option. From here provide the files needed by the email router:


All of these files can be found in the folder C:Program FilesMicrosoft CRM EmailService if you did not change the installation path of the Router when it was installed.

Note: You may have to edit security the permissions on these files to allow you to upload them. In my case I was required to grant my user Read access to the EncryptionKey.xml and Microsoft.Crm.Tools.EmailAgent.xml files.

Switching from an Email Router to Server-Side Sync in Dynamics CRM 2013

2.  After you have the files ready to upload, click next through the following screens and Finish on the summary page. The summary page does advise on what needs to be done next.

Switching from an Email Router to Server-Side Sync in Dynamics CRM 2013

Since we are migrating to Server Side Synchronization, we will assume that all user specific email settings are already configured in CRM. If not, check out step 4 of our blog on Email Router Troubleshooting 101.

Now all that is left to do is make a settings change and then test the mailbox.

3.  Click the Email Configuration Settings from the Email Configuration screen.

Switching from an Email Router to Server-Side Sync in Dynamics CRM 2013

4.  In the pop-up window, select Server-Side Synchronization in the Process Email Using dropdown and click OK. You should Also notice the name of the server profile (shown in the migration screen) in the box below.


5. Click the mailboxes on the email configuration screen. Then, select the mailbox that you would like to test and choose Test and Enable. 

Switching from an Email Router to Server-Side Sync in Dynamics CRM 2013

Switching from an Email Router to Server-Side Sync in Dynamics CRM 2013

6.  On the pop-up screen, select OK as we only want to test one mailbox for now. We can leave the first check box selected as this box will test the mailbox after the new settings are applied to it. Also, note the checkbox at the bottom of the window, you should make this selection if all users are the member of only one CRM organization.

Switching from an Email Router to Server-Side Sync in Dynamics CRM 2013

7.  After you have clicked OK, wait a few minutes and then open the mailbox record.

When you do this you may get one of the following messages:

Switching from an Email Router to Server-Side Sync in Dynamics CRM 2013

Switching from an Email Router to Server-Side Sync in Dynamics CRM 2013

If you see either of these messages, check back on the mailbox later to see if the test has been completed. If not, you should see Success in the appropriate boxes under Configuration Test Results. In this case, I only tested outgoing email.

When the test finishes you should see Success in the fields that were tested successfully. In this case, we only tested an outgoing profile.

Switching from an Email Router to Server-Side Sync in Dynamics CRM 2013

8.  Once this is finished, apply the default settings to the remaining mailboxes and Test & Enable. When the test completes, all users will be using Server-Side Synchronization.

More on Server-Side Sync

If you are interested in learning more, The CRM Book explains all the advantages and limitations of this new feature for CRM 2013! Check in with our blog for other updates and, as always... Happy CRM'ing!