Category Archives: Computers and Internet

CRM 2011 Custom reports gives error: rsProcessingAborted

SYMPTOMS: Custom reports do not work with an SSRS log error similar to:

System.ServiceModel.Security.SecurityNegotiationException: A call to SSPI failed, see inner exception.
System.Security.Authentication.AuthenticationException: A call to SSPI failed, see inner exception.
System.ComponentModel.Win32Exception: The target principal name is incorrect —>

PROBLEM: This happens if the SPNs of the CRM web service is not set properly and SSRS server is unable to get a Service Ticket from the Ticket Granting Server (TGS).

SOLUTION: Register the following SPNs:

setspn -a http/<CrmApplicationServerName> <CrmAppPoolServiceUserAccount> (E.g. setspn -a http/crm DOMAIN\SVCCRM)

setspn -a http/<CrmApplicationServer FQDN> <CrmAppPoolServiceUserAccount> (E.g. setspn -a http/ DOMAIN\SVCCRM)


CRM 2011 E-mail router issue – SetPriority null


ACTION: Trying to send an email via workflow step.

RESULT: The below error appears on the event log.

#61042 – An error occurred while processing the outgoing e-mail message with subject “xxxxxxx” for SMTP: for delivery through SMTP-SERVER-NAME.

System.NullReferenceException: Object reference not set to an instance of an object.

at Microsoft.Crm.Tools.Email.Providers.SmtpPollingSendEmailProvider.SetPriority(OptionSetValue priority, MailMessage mailMessage) at Microsoft.Crm.Tools.Email.Providers.SmtpPollingSendEmailProvider.PrepareMessage(Entity sendEmail)   at Microsoft.Crm.Tools.Email.Providers.SmtpPollingSendEmailProvider.ProcessMessageInternal(Entity emailMessage)

   at Microsoft.Crm.Tools.Email.Providers.CrmPollingSendEmailProvider.Run()

CAUSE: The migration from CRM4.0 to CRM2011 caused some email templates to become corrupted.

RESOLUTION: Recreated email fields (removed and replaced To and From fields).

I had a session with Microsoft Support on this issue and we found a solution. The problem was that the workflows were created in CRM 4.0 and then upgraded to CRM 2011. The solution was to re-save all the e-mail templates within the workflows.

I opened the “create e-mail task”, removed To and From recipients and then re-inserted the same recipients and saved and re-activated the workflows. Now I could se that the Priority of the mail message was set to Normal instead of “blank”. And the mail got through.

So if you upgraded from CRM 4.0 this might be your problem.

Keep alive VPN

Having trouble with an unstable VPN connection? Try to keep it alive or troubleshoot by opening a command prompt and doing a “ping –t ipnumber” when connected over VPN. This will keep sending pings until you use Ctrl+C to end the loop, this way keeping the connection alive.

System.DirectoryServices slow after 15 seconds

Symptoms: When using .NET Framework System.DirectoryServices hosted in an WCF or Web Services the first LDAP query is really slow but the following are fast. Then, after beeing idle for 15 seconds or more the following LDAP query is really slow again. The queries work, the only problem is the initial overhead when creating a connection to the LDAP server. And after 15 seconds the WCF thread pool recycles.

Cause: The issue could be caused by a mismatch in server certificate if your not calling from the same domain.

Resolution: Use System.DirectoryServices.Protocol instead in order to ignore certificate errors and turn off ReferralChasing.

Code example:

Continue reading

TimeSpan formatting as extension method C#

Here’s a simple extenstion method to format a TimeSpan object as total number of hours and minutes (HH:MM) wich supports total hours above 24.

namespace YourProject.ExtensionMethods
    public static class Extensions
        public static string ToHHMMString(this TimeSpan span)
            int totalHours = (int) span.TotalHours; //truncate decimals
            return totalHours.ToString(“00”) + “:” + span.Minutes.ToString(“00”);

CRM 2011 Change organization and database name

You can easily change the display name of an CRM 4.0 and 2011 organization by disabling the organization in the Deployment manager and then edit the organization display name property. But changing the display name does not change the server url or database name.

Here’s how to:

  1. From CRM Deployment Manager
    1. Disable the organization.
    2. Select Edit Organization and change the Display name to <NewName>.
    3. Delete the organization.
  2. From SQL Server Management Studio
    1. To prevent the database being locked, take the organization datbase offline (Tasks –> Take offline) then bring it back online (Tasks –> Bring online).
    2. Rename the database to the new name
      1. Newname_MSCRM.
  3. From CRM Deployment Manager
    1. Choose import organization and select the newly renamed database. Follow the wizard and your done!