Skip to main content

How to make yourself a Dynamics CRM 2011 Deployment Administrator

Today I needed to deactivate one of our Dynamics organisations, but when I opened the Dynamics Deployment Manager, I received the following error:

"Only the Deployment Administrators are able to use Deployment Manager. You are not a Deployment Administrator."

Bummer. I did a bit of Googling and found this post by Ronald Lemmen (thanks for pointing me in the right direction!).  Since the Dynamics Deployment Manager is obviously checking the MSCRM_CONFIG database for this information I attached a database trace to it and found that it's executing these queries (among many others):

exec sp_executesql N'SELECT  Id, [DefaultOrganizationId], [IsDisabled], [Name]  
FROM [SystemUser]  
WHERE ((([Name] = @Name0)) ) AND (IsDeleted = 0) ',
N'@Name0 nvarchar(41)',@Name0=N'{My windows domain account}'

exec sp_executesql N'SELECT  Id, [Name], [UniqueifierId]  
FROM [SecurityRole]   
WHERE ((([Name] = @Name0)) ) AND (IsDeleted = 0) ',
N'@Name0 nvarchar(13)',@Name0=N'Administrator'

exec sp_executesql N'SELECT  Id  
FROM [SystemUserRoles]  
WHERE ((([SecurityRoleId] = @SecurityRoleId0) AND ([SystemUserId] = @SystemUserId1)) ) AND (IsDeleted = 0) ',
N'@SecurityRoleId0 uniqueidentifier,@SystemUserId1 uniqueidentifier',
@SecurityRoleId0='{ID of Admin Role}',@SystemUserId1='{ID of my SystemUser record}'

From there it was actually a pretty simple task: insert a couple records to SystemUser and SystemUserRoles to indicate that my domain account is in the "Administrator" role

(Name, IsDeleted, DefaultOrganizationId, Id, IsDisabled) VALUES
('{My windows domain account}', 0, '00000000-0000-0000-0000-000000000000', NEWID(), NULL)

INSERT INTO [SystemUserRoles]
(Id, SecurityRoleId, SystemUserId, IsDeleted) VALUES
(NEWID(), '{ID of Administrator Role}', '{ID of the SystemUser record just created}', 0)

And now I can open Dynamics CRM Deployment Manager!


  1. Thank you, man, you save my life !

  2. Thanks for this post.
    -I demoted an AD from the server running Dynanmics 365 on-premise installation and promoted the server to another Domain controller.
    -I am now locked out.
    -The solution explained here does not work for me on Dynamics 365. Also, the columns change if an organization is using some other DB other than the default MSCRM_CONFIG
    - How did you trace the SQL query being called for checking the permission by CRM deployment manager?

    1. Dang, sorry that my little hack wasn't helpful in your situation :(

      It's understandable that a lot of things have changed in the database architecture between Dynamics 2011 and 365, and tricks like this are probably not even advisable on the version they were written for!

      I use SQL Server Profiler to trace database queries, but I'm not sure if this will work with Dynamics 365 since you need to connect directly to the database and have the ALTER TRACE permission. More info here if it helps:


Post a Comment

Popular posts from this blog

'A section using configSource may contain no other attributes or elements' error after installing Application Insights

After installing the Application Insights nuget package to an Umbraco solution, you'll get this error:

A section using 'configSource' may contain no other attributes or elements

<ExamineLuceneIndexSets configSource="config\ExamineIndex.config" />
     <log4net configSource="config\log4net.config">
             <level value="ALL" />
             <appender-ref ref="aiAppender" />
Source File: \project\web.config

This happens because part of the Application Insights installation process adds a <log4net> section to web.config.  Which would make sense, except Umbraco already has a <log4net> section in /config/log4net.config.  So as you can imagine, the solution is to manually move everything its added into that file. Unfortunately you can't just copy/paste the whole lot, but it's not particularly complicated:

Move <appender-ref ref="aiAppender" /> into the lo…

Handling double-quoted CSVs in Azure Data Factory Pipelines

Azure Data Factory by default uses a backslash as the escape character for CSVs, but we ran into an issue with this today processing one of the CSV files from  As with most CSVs they use quotes around values as normal and with double-quotes for empty values, but they also use double-quotes to escape quotes within non-empty values. This probably sounds confusing, so here's an example:

"column 1","column 2","","column 4 value is ""sort of"" like this"

The ADF pipeline failed because the double-quotes don't get escaped correctly:
ErrorCode=UserErrorSourceDataContainsMoreColumnsThanDefined, found more columns than expected column count.

The solution was to change the "Escape character" property on the dataset, by clicking the "Edit" button beneath it and manually entering "", since "" isn't in the list of escape characters.  I didn't think this would work at fir…

Using WiX to create an event source during install of a .NET framework project

Edit: so I guess I wasn't the only one confused with this stuff, as it's been my most popular post by far!  If I've helped you out or saved you some time, please let me know in the comments :)

In order for this to work, you have to add references to WixUtilExtension and WixNetFxExtension to your WiX project.  Once that's done, add this inside a <Component> element:

<Util:EventSourcexmlns:Util=""Name="EVENTSOURCEGOESHERE"Log="Application"EventMessageFile="[NETFRAMEWORK40FULLINSTALLROOTDIR]EventLogMessages.dll" />
Obviously replace EVENTSOURCEGOESHERE with your event source name.  NETFRAMEWORK40FULLINSTALLROOTDIR is a property set by the WixNetFxExtension which stores the path to the .NET framework v4 directory, but you can replace this with the corresponding property for the directory containing the relevant EventLogMessages.dll file.  So if you're using the .NET framewo…