Archiv des Autors: ckeller

MissingMethodException at E-Mail-Router installation

This week I’ve installed the E-Mail-Router for a customer. During the setup an error came up

Action Microsoft.Crm.Setup.Exchange.GenerateEncryptionKeyAction failed.

Method not found: ‚Boolean Microsoft.Crm.ApplicationConfig.IsFederalInformationProcessingCompliant()‘.

The cause of this error was a pending restart which was requested by Windows Update. I have no clue if a specific update was the cause of the problem, or the system state itself.
However, after rebooting the machine, the error went away and the setup was successful.

So keep in mind, if the pre-checks warns you about a pending reboot, it is sometimes better not to ignore this hint 😉

Manage Dynamics CRM 2011 with PowerShell

With the beta of Dynamics CRM 2011, Microsoft offers the ability to script deployment management tasks with PowerShell.

The server role ‚Deployment Tools‘ contains a set of PowerShell cmdlets to script Deployment Manager tasks.

After you have installed the Deployment Tools role you are able to add the Dynamics CRM PowerShell-Snap-In to your PowerShell session.

To use the cmdlets you have to enter following command into a PowerShell console, which adds the PowerShell-Snap-In to your active session.

Add-PSSnapin Microsoft.Crm.PowerShell

After this the CRM Snap-In will be listed when you enter this command


Make sure that the result contains

Name : Microsoft.Crm.PowerShell
PSVersion : 2.0
Description : A Windows PowerShell snap-in containing cmdlets that manage components of Microsoft Dynamics CRM.

Now, you can view the cmdlets which are defined in the Snap-In with following command

Get-Command -Module Microsoft.Crm.PowerShell

At the moment of writing this post, following cmdlets are available


This is a great enhancement for managing a crm deployment. You can speed up your administrative tasks, if you add this Snap-In to your profile. See

Why OptimizeOrgImport is not always an optimization

Update Rollup 8 introduced an improved organization import process which speeds up the organization import.

You have to enable the optimized import process by adding the DWORD key OptimizeOrgImport with value 1 to the registry hive of Dynamics CRM (see the detailed description

Recently, I had a problem during an import of an organization which failed with following error

Message: Exception during import of organization (Name=‘‚, Id=3e58a0cc-c277-df11-b2c1-0050569473db):
System.Data.SqlClient.SqlException: A row with a duplicate key cannot be added to the object ‘dbo.SystemUserOrganizations’-object with unique index ‘SystemUserOrganizations_CrmUserId’

The organization which I tried to import was a backup of an organization which was created in the same deployment. The import runs successful on every other deployment. With help of the Microsoft Support, we identified the cause of the issue: the OptimizeOrgImport key.

The knowledgebase article for OptimizeOrgImport contains following passage:

When you use the registry entry OptimizeOrgImport and have the value of this entry set to 1, you cannot import the same organization database more than one time.
If you want to import the same organization database more than one time, you must do one of the following things:

  • Set OptimizeOrgImport = 0 and use the normal import process.
  • Delete the organization, and then import the organization again.

This passage is a little bit misleading, as the optimized import process fails already at the first time, if the organization was created in the same deployment. In order to import a backup of an organization into the originating deployment, you have to deactivate OptimizeOrgImport.

Howto: Use pre-generated Guids for records

A customer asked me recently if it is possible to get the id of a record in a pre-create plugin. By default, it is not possible because the record is not yet created at this point and has not got an id.

However, Dynamics CRM allows you to create your own id for a record. The primary key of a record is stored in its Key-Property. On all default entities, for example account, the id property is marked as Valid for create (see accountid). This means, the sdk allows you to pass your own id.

using System;
using Microsoft.Crm.Sdk;
namespace PreCreateKeyPlugin
    public class PreCreateKeyPlugin : IPlugin
        public void Execute(IPluginExecutionContext context)
            if (IsPreCreate(context))
                if (context.InputParameters.Contains(ParameterName.Target))
                    DynamicEntity target = context.InputParameters[ParameterName.Target] as DynamicEntity;
                    if (target != null)
                        Guid customId = new Guid("{d7256b93-a5b5-45f9-9f2d-a1838279c35c}");
                        target["accountid"] = new Key(customId);
        private bool IsPreCreate(IPluginExecutionContext context)
            return  context.MessageName == MessageName.Create && 
                    context.Stage == MessageProcessingStage.BeforeMainOperationOutsideTransaction;

If you register this plugin for pre-create on the account entity and create a new account, it will have the provided id.

Please keep in mind, that you are in the responsibility to assign an new GUID for every execution of this plugin, but this should be clear when working with primary keys.