Find out deployment administrators

When starting the deployment manager (start -> programs -> microsoft dynamics crm ->deployment manager) you might get the bugged with a message when you're not the deployment administrator of the machine. This even happens when you're domain admin, sys admin on the database and/or local admin on the machine:

"Only the Deployment Administrators are able to use the deployment manager"

The only way to start the deployment manager, is when you're a deployment administrator. And guess what, the only place to add you as a deployment administrator is within the deployment manager tool. Catch 22? Not really, because the person who installed Dynamics CRM is added as a deployment administrator automatically. However, if you have no clue who this is, then you can get this information from SQL server.

The following query will provide you with a list of all the deployment administrators of your environment:
SELECT Name, IsDisabled, Name, IsDeleted FROM [MSCRM_CONFIG].[dbo].[SystemUser]
WHERE DefaultOrganizationId ='00000000-0000-0000-0000-000000000000'

How to find out which SQL server is used by CRM? You won't believe it, you can get this information from the servers tab in the deployment manager* ;)

*or windows register: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSCRM



Restore missing user in MSCRM_CONFIG

In some rare scenario's you'll not be able to login to CRM though you are sure that you're use has been added to the organization and you have a security role as well. The pesky error message generally is:

404 - File or directory not found.
The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable.

If this is the case, then it could be that your user is missing in the MSCRM_CONFIG database. Especially if you're moving around database with backup and restore, then this could happen. If you think this could be the case in your scenario, then make sure to start a SQL profiler and grab the entry that shows up when refreshing the page. It would like like this:

exec sp_executesql N'exec p_GetCrmUserId @OrganizationId, @AuthInfo',N'@OrganizationId uniqueidentifier,@AuthInfo nvarchar(46)',@OrganizationId='0474D466-1234-E311-1234-A02B3F591536',@AuthInfo=N'W:S-1-5-21-123456789-1234567890-123456789-1234'

When executing that query against the MSCRM_CONFIG you should not get any result. If this is indeed the case, then you can add your user back into this table with the query below. The usual statements apply, backup first, unsupported and only execute this when you know what you're doing.

USE [MSCRM_CONFIG]
GOINSERT INTO [dbo].[SystemUserOrganizations]
([CrmUserId]
,[Id]
,[OrganizationId]
,[UserId]
,[IsDeleted]
)
VALUES
((select systemuserid from [2011FR2_MSCRM].dbo.SystemUserBase where DomainName='[domain]\[username]')
,NEWID()
,(select id from organization where DatabaseName = '[ORG]_MSCRM')
,(select userid from SystemUserAuthentication where authinfo='[Auth info as copied from the SQL profiler')
,0
)
GO
 



Find missing dependencies when deleting a solution

When deleting a solution in Dynamics CRM, the system checks for dependencies first. If any of the dependencies still exist, then the delete operation will be aborted and the user will receive an error message:

Connot Delete Component (Cannot delete Main because one or more components require it."

The only option for more info, is the Download Log File, but this doesn't tell you really what happened either:

Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=7.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: The Main() component cannot be deleted because it is referenced by 1 other components. For a list of referenced components, use the RetrieveDependenciesForDeleteRequest.Detail:
<OrganizationServiceFault xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/xrm/2011/Contracts">
<ErrorCode>-2147160033</ErrorCode> <ErrorDetails xmlns:d2p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic">
<KeyValuePairOfstringanyType><d2p1:key>0</d2p1:key><d2p1:value xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:string">Main</d2p1:value></KeyValuePairOfstringanyType>
<KeyValuePairOfstringanyType><d2p1:key>1</d2p1:key><d2p1:value xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:string"></d2p1:value></KeyValuePairOfstringanyType>
<KeyValuePairOfstringanyType><d2p1:key>2</d2p1:key><d2p1:value xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:string">1</d2p1:value></KeyValuePairOfstringanyType>
<KeyValuePairOfstringanyType><d2p1:key>3</d2p1:key><d2p1:value xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:string">Solution</d2p1:value></KeyValuePairOfstringanyType>
<KeyValuePairOfstringanyType>
<d2p1:key>4</d2p1:key>
<d2p1:value xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:string"><a id='a_helplink' tabindex='0' class='ms-crm-Dialog-Error-Link' onclick='openStdWin("\x2ftools\x2fdependency\x2fdependencyviewdialog.aspx\x3fobjectid\x3d\x257b703af1df-aafb-4c61-b97f-da639fbe8d27\x257d\x26objecttype\x3d7100\x26operationtype\x3ddependenciesforuninstall", null, 800, 600, null)'>Details</a></d2p1:value>
</KeyValuePairOfstringanyType>
</ErrorDetails>
<Message>The Main() component cannot be deleted because it is referenced by 1 other components. For a list of referenced components, use the RetrieveDependenciesForDeleteRequest.</Message>
<Timestamp>2015-02-12T12:24:36.2628436Z</Timestamp>
<InnerFault i:nil="true" />
<TraceText i:nil="true" />
</OrganizationServiceFault>

However, there seems to be a little bit of useful info in there. This is the section "\x2ftools\x2fdependency\x2fdependencyviewdialog.aspx\x3fobjectid\x3d\x257b703af1df-aafb-4c61-b97f-da639fbe8d27\x257d\x26objecttype\x3d7100\x26operationtype\x3ddependenciesforuninstall". When replacing some chracters ("\x2f" to "/", "\x3" to "?", "\x3d" to "=", "\x26" to "&", "\x257b" to "{" and "\x257d" to "}"), then you're presented with the url: /tools/dependency/dependencyviewdialog.aspx?objectid={703af1df-aafb-4c61-b97f-da639fbe8d27}&objecttype=7100&operationtype=dependenciesforuninstall. Add "http://[yourserver] to the beginning and you've got your url that'll tell you exactly what dependencies to remove before you can remove the (managed) solution.

A shorter approach, but just as effective would be to take this url and change yourserver and the solution guid:

http://yourserver/tools/dependency/dependencyviewdialog.aspx?objectid={solutionguid}&objecttype=7100&operationtype=dependenciesforuninstall

Your solution guid can be found by opening the solution and pressing F11 or CTRL+N to see the url. In the url take the section between %7b and %7d: https://[yourserver]/tools/solution/edit.aspx?id=%7bC418E1D5-9AFB-E311-90E1-00155D042F50%7d) and you're set to go!



CRM Outlook Client 2011 on a Windows Server 2012?

In some scenario's you might want to install the CRM Outlook Connector for Microsoft Dynamics CRM 2011 on a server which is newer than the Implementation Guide mentions as supported operating systems.
When trying to do so, you'll quickly find yourself facing the following scenario:




The error message is:
The installation has failed. The computer is running an operating system that Microsoft Dynamics CRM does not support. To install this product, you must upgrade your computer to a supported operating system.

Interesting, because you actually need to degrade your computer. However, the next trick will allow you to install the Outlook client after all. Use the properties on the setup file and let Windows figure out the compatibility mode and 'test' the program. This will allow the setup to run and install the add-in.

Please note that I don't recommend this approach as Microsoft may make any update in the future which causes the Outlook Client to have issues.

Here's the process in screenshots:
















Note: when the install doesn't want to pass the Windows Update, then have a look if there's a popup open somewhere started by the Windows Update. This could be an update rollup or any other update that needs your attention as well.

Good luck!



.NET Framework 3.5 install on a Windows 2012 machine

For some applications it's required to have .NET Framework 3.5 installed on your Windows 2012 machine. Some of these applications include SQL 2014 and CRM 2015.

The ususal option is to select the ".NET Framework 3.5 Features" in the "Add Roles and Features Wizard" of the windows server manager. However, in some scenario's this leads to the following error message:

Installation of one or more roles, role services, or features failed.
The source files could not be found. Try installing the roles, role services, or features again in a new Add Roles and Features Wizard session, and on the Confirmation page of the wizard, click "Specify an alternate source path" to specify a valid location of the source files that are required for the installation. The location must be accessible by the computer account of the destination server.

Now if you have the windows 2012 disc at hand, you can follow the next statement.
DISM /Online /Enable-Feature /FeatureName:NetFx3 /All /LimitAccess /Source:d:\sources\sxs
If you don't have the windows 2012 disc at hand, you can force the installer to grab .NET Framework 3.5 from the Windows Update. You can do that using the following statement in the command prompt:
DISM /Online /Enable-Feature /FeatureName:NetFx3 /All

For more details see Technet: https://technet.microsoft.com/en-us/library/hh831809.aspx#BKMK_dism