"Value cannot be null" when configuring the Exchange connector for Service manager

Did you ever try to create an Exchange connector (version 3.1) in System Center Service Manager 2012 R2 console ?

If yes, you know it is quite straightforward ... but sometimes, when you entered next in this screen

 Patatra ! it crashes with a message telling you that a Value cannot be null...

As you are curious, you look at the stack trace and you can see a line similar to :

     at Microsoft.SystemCenter.ExchangeConnector.InboxConnectorWizardDataLists.IncidentTemplatesList()

So, there is something related to your templates of incidents. But where are these templates ?

They are described in this MP :      ServiceManager.IncidentManagement.Configuration.xml.

So, let's export this MP. You can see in this file a lot of lines similar to

                <ObjectTemplate ID="Template.e46dc50d61ad44d398082a5c3c339150" ...

then, after, a related section like

                <DisplayString ElementID="Template.e46dc50d61ad44d398082a5c3c339150">

The Exchange connector is not happy if there is an ObjectTemplate without any DisplayString

OK, fine, but, you know what ? There are usually a lot of ObjectTemplate lines to check !!!

So, I just created a (very dirty) Powershell script which will display the ObjectTemplate without any DisplayString.

In order to use it, you have to

-- Create a directory

-- Copy in this directory these 2 files : CheckDisplayName.ps1 and ServiceManager.IncidentManagement.Configuration.xml you exported before

-- Open a windows powershell command, go in your directory and run .\CheckDisplayName.ps1

In my case, I got this output showing this template

 So, now, you have to

-- Save your current ServiceManager.IncidentManagement.Configuration.xml in a safe place

-- Open  ServiceManager.IncidentManagement.Configuration.xml  with your favorite editor

-- Locate this specific  <ObjectTemplate ID="Template.9c028a3494c64b7fbfbce2eac9caf54e" section and delete the complete section, beginning with <ObjectTemplate  and finishing with </ObjectTemplate>

-- Import the modified ServiceManager.IncidentManagement.Configuration.xml 

and now the connector is no more crashing. Yes !

 

CheckDisplayName.zip