• eLogic

Dynamics CRM Tech Tip – Re-enabling a Service / Administrator Account via SQL Command


Dynamics CRM Tech Tip – Re-enabling a Service / Administrator Account via SQL Command

Dynamics CRM’s batch user edit functionality is a great time saver, and includes the option to enable and disable users in big chunks. However, this can be dangerous if you’re not paying close attention to what you’re doing!


If you’ve ever made the mistake of disabling a Service Account or System Administrator in Microsoft Dynamics CRM, you know it can be a serious pain to get back.

A disabled service account can lock out all users from your system, and if all administrator accounts become disabled, you will need to re-enable at least one of them to get in and fix the other users.


If you don’t have the ability to log into your CRM application due to one of the above scenarios, you can reset users to enabled through a SQL command.


The SQL Command to enable a disabled user is the following, and must be run against the CRM SQL Server database:


Update SystemUserBase SET IsDisabled='false' WHERE (DomainName = ‘username')


Username will be where you will insert the name of the user to be re-enabled. You may also need to include your domain in the username depending on your user account setup schema.


Once you have executed this command, restart IIS and you should be able to log into Dynamics as this user normally.


As always when executing direct SQL commands, it is wise to consult an experienced DBA and take a backup of your database before executing.