FIX: The trust relationship between this workstation and the primary domain failed

Posted by on Feb 7, 2014 in Windows Server 2012 |

Recently after a Hyper-V migration, one of our servers gave us this dreaded message “The trust relationship between this workstation and the primary domain failed”

I really didn’t feel like removing it from the domain and re-adding it causing all sorts of SID problems.

According to the Microsoft TechNet article:

The Reset-ComputerMachinePassword cmdlet changes the machine account password that the computers use to authenticate to the domain controllers in the domain.

Reset-ComputerMachinePassword [-Credential Domain\DomainAdmin ] [-Server DomainController ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Log on locally, run the powershell command and your problem is now sorted.

Read More

Disable SharePoint Authentication prompts for Office Documents

Posted by on Feb 4, 2014 in SharePoint 2010 Foundation, SharePoint 2010 Server |

Depending on your setup, users will at times receive an authentication prompt when opening Microsoft office documents even when the site is in the Trusted Sites list or the Intranet sites list. There are reasons for this which are complex but you may have a good read of the KB article:

The fix is to modify the SharePoint web application config file (web.config) in the app directory to specifically bypass the authentication prompts. As a rule of thumb, please backup your web.config before making any changes.

    <requestFiltering allowDoubleEscaping="true">
      <!-- here's where the magic happens -->
      <verbs allowUnlisted="true">
        <add verb="OPTIONS" allowed="false" />
        <add verb="PROPFIND" allowed="false" />
Read More

Cannot install Reporting Extensions for 2013 with the 2011 extensions installed on the same SQL server

Posted by on Feb 4, 2014 in CRM 2011, CRM 2013 |

The Microsoft Dynamics CRM 5.0 Connector for SQL Server Reporting Services must be uninstalled before Microsoft Dynamics CRM 2013 Reporting Extensions can be installed.

The error occurred when I was trying to install the reporting extensions for a new CRM 2013 demo instance as you cannot import an existing organisation without the reporting extensions.

Unfortunately there is no way around this (that I have found) and for the demo purpose I installed SQL on the same box as CRM.

Read More

CRM 2011 – Set the Email regarding field to the contact in the recipient address

Posted by on Nov 13, 2013 in CRM 2011 | 2,950 comments

Scenario: An email gets sent out and copies in the Queue Email Address. The Email router picks up the email and sticks it in the queue. Client wanted to automatically track the the email against the contact in the recipient address automatically (note: all contacts getting emails sent to already exist as contacts in the system). There was no way to do this using the workflow engine since the Recipient field and the Regarding field are two different types (partylist vs entityreference). I created a  plug-in to do the job. Register the plugin on pre-operation and this should do the job.


using Microsoft.Xrm.Sdk;
using Microsoft.Xrm.Sdk.Query;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WC.CRM
    public class WCEmailPlugin : IPlugin
        public void Execute(IServiceProvider serviceProvider)
            var context = (IPluginExecutionContext)serviceProvider.GetService(typeof(IPluginExecutionContext));

            if (context.Depth &gt; 1)

            var serviceFactory = (IOrganizationServiceFactory)serviceProvider.GetService(typeof(IOrganizationServiceFactory));
            var service = serviceFactory.CreateOrganizationService(context.UserId);

            if (context.InputParameters.Contains("Target") &amp;&amp;
                context.InputParameters["Target"] is Entity)
                // Obtain the target entity from the input parmameters.
                var entity = (Entity)context.InputParameters["Target"];
                    if (entity.Attributes.Contains("to") &amp;&amp; entity.Attributes.Contains("subject"))
                        var recipients = entity.GetAttributeValue&lt;EntityCollection&gt;("to");
                        foreach (var party in recipients.Entities)
                            var partyName = party.GetAttributeValue&lt;EntityReference&gt;("partyid").Name;
                            var partyId = party.GetAttributeValue&lt;EntityReference&gt;("partyid").Id;
                            var partyType = party.GetAttributeValue&lt;EntityReference&gt;("partyid").LogicalName;
                            if (partyType == "contact")
                                var contactRec = service.Retrieve("contact", partyId, new ColumnSet(true));
                                entity["regardingobjectid"] = new EntityReference() { LogicalName = "contact", Id = partyId, Name = contactRec.GetAttributeValue&lt;string&gt;("fullname") };
                catch (Exception ex)
                    throw new InvalidPluginExecutionException("Error: " + ex.Message);
Read More

CRM 2011 – Show Group Titles using the SiteMap

Posted by on Nov 8, 2013 in CRM 2011 | 3,238 comments

In Dynamics CRM 2011 I created a new area with new groups however they are not grouped by the Title (i.e:. Title is not showing). Navigate to the Area Element in the SiteMap and add the ShowGroup=”true” 


Heres the modified XML file

  <Area Id="SMS" Description="Information System" Title="Information System" ShowGroups="true">
    <Group Id="centre_management" Description="Centre Management" Title="Centre Management" IsProfile="false">
      <SubArea Entity="ecs_centre" Id="nav_centre" AvailableOffline="false" PassParams="false" />
      <SubArea Entity="ecs_centreroom" Id="nav_centreroom" AvailableOffline="false" PassParams="false" />
      <SubArea Entity="ecs_faculty" Id="nav_faculty" AvailableOffline="false" PassParams="false" />

This will now display the group headings.


Read More