Skip to content

Unable to add users in Dynamics 365 On Premise

Recently again, we ran into an issue with our Staging environment where we were unable to add users to the Dynamics 365 On Premise Organization(s).

About the Environment

Our Staging environment was a bit different from the Development environment where we had one server for CRM and the other for SQL. Staging on the other had 2 Front End Servers and 2 Back End Servers with 2 SQL Servers. The 2 Front End and 2 Back End Servers were load balanced (which kind of mimic-ed the Production environment). F5 was used for load balancing. There were 3 Domain Controllers.

Issue Explained

Now here’s how adding users worked in Staging for us. Keying in the username would notĀ populate the user details (full name, email, phone number, title, etc.) from Active Directory because of the security restrictions imposed. So the way we added users was key in the username, tab out and fill in the user informationĀ (full name, email, phone number, title, etc.) manually and hit “Save” and everything would work fine. However, this time when we tried the same process, it threw an exception and didn’t add the user!

Downloading the log file gave us this, which wasn’t very useful (to be honest):

We resorted to tracing to find out what was going on in the servers. If you want to know about how to enable advanced tracing, please look at my previous post here.

This is what we got from the trace log, which kind of pointed to the fact that the CRM Server was unable to communicate with the Active Directory and verify that the user actually existed in the Active Directory. (The trace file is pretty huge).

How to Fix it?

So here’s what was happening. The CRM Server was unable to connect to the Domain Controller and hence validate the user against Active Directory.

The fix to this, a registry key needed to be added in the CRM Server(s).

Now, before you add the registry key you need to find out what the preferred DC (Domain Controller) is. To get that, fire up Command Prompt as Administrator and run the following command in your CRM Server box:

This will give you something called the “LOGONSERVER”.

You need to use that for the registry key.

Add the following registry key under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSCRM

Registry Key Type Value
PreferredDc String LOGONSERVER

Replace LOGONSERVER with the actual value you got from Command Prompt.

If you have multiple CRM Servers (Front End, Back End), make sure you add the same registry key in all of those servers. In our case, we had 4 servers, so we had to add them in all 4 of them.

Once done, restart the servers (all of them).

Clear browser cache and cookies and try adding the user. It should start working! (That did the trick for us).

Hope this helps!

Published inDynamics 365 CE (CRM)Tutorials Dynamics 365

Have something to add?

Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Loading Facebook Comments ...
Loading Disqus Comments ...

No Trackbacks.