Exchange connector in service Manager

July 26, 2012

Hello,
Today we focus on the exchange connector in service manager. Available for the 2010 and the 2012 versions. Why would you need it ?
Wel it does some nifty things like :

  • Convert email to ticket without relying on an smtp server
  • Allowing updates of a work item using “reply” to email ( such as additions to the incident, approvals of the CR, closing of incidents etc. )

Now where can we find it ? Well that’s easy : http://www.microsoft.com/en-us/download/details.aspx?id=24957 ( 2010 version ) and http://www.microsoft.com/en-us/download/details.aspx?id=29423 ( 2012 version )




First of all let me explain that the connector actually has an additional feature besides the ones described above. Image the following scenario :

  • Analyst requests user information using the default “request user input” button
  • The incident is put on status “pending” and a mail sent to the affected user
  • The default email templates allow you to add the analyst comment as a field however :
    • This will add all the analyst comments to the email and we only want the question posed by the Analyst. Furthermore the order in which the comments are displayed is not correct.I thought this was fixed since 2010SP1 but this is not the case.


I used the group attribute for formatting the comment list.


Now for this there is a second part of the connector solution allowing you to just send the question using an email template to the affected user.
First of all let me explain that all the info here has been provided by Travis in the document attached to the solution. Be sure to read it. This is just the hands-on test.

  • Import the attached SendEmail.mpb file


  • Add wanted item to list item Message Type. Use a new MP.


  • Create a new email template for your desired scenario.Select the newly created MP.


  • Insert the custom Message as variable in the Template



  • Create an incident workflow


  • Specify Criteria




  • Apply a template for setting the status to pending of the specific incident.


  • So far, so good ! Now for the tricky part. Export the Mp and Edit. Look for <UpdateInstance> and modify like explained.
Before After
<Criteria>
<Expression>
<And>
<Expression>
<UnaryExpression>
<ValueExpression>

<Property
State=Pre>$Context/Property[Type=’SendEmail!IncidentSendMailExtension’]/Message$</Property>

</ValueExpression>

<Operator>IsNull</Operator>

</UnaryExpression>

</Expression>

<Expression>

<And>

<Expression>

<SimpleExpression>

<ValueExpression>

<Property
State=Post>$Context/Property[Type=’SendEmail!IncidentSendMailExtension’]/MessageType$</Property>

</ValueExpression>

<Operator>Equal</Operator>

<ValueExpression>

<Value>{9f6d72ad-1bff-ca89-f619-8d50cd876576}</Value>

</ValueExpression>

</SimpleExpression>

</Expression>

<Expression>

<UnaryExpression>

<ValueExpression>

<Property
State=Post>$Context/Property[Type=’SendEmail!IncidentSendMailExtension’]/Message$</Property>

</ValueExpression>

<Operator>IsNotNull</Operator>

</UnaryExpression>

</Expression>

</And>

</Expression>

</And>

</Expression>

</Criteria>

<Criteria>
<Expression>
<Or>
<Expression>
<And>
<Expression>

<UnaryExpression>

<ValueExpression>

<Property
State=Pre>$Context/Property[Type=’SendEmail!IncidentSendMailExtension’]/Message$</Property>

</ValueExpression>

<Operator>IsNull</Operator>

</UnaryExpression>

</Expression>

<Expression>

<And>

<Expression>

<SimpleExpression>

<ValueExpression>

<Property
State=Post>$Context/Property[Type=’SendEmail!IncidentSendMailExtension’]/MessageType$</Property>

</ValueExpression>

<Operator>Equal</Operator>

<ValueExpression>

<Value>{9f6d72ad-1bff-ca89-f619-8d50cd876576}</Value>

</ValueExpression>

</SimpleExpression>

</Expression>

<Expression>

<UnaryExpression>

<ValueExpression>

<Property
State=Post>$Context/Property[Type=’SendEmail!IncidentSendMailExtension’]/Message$</Property>

</ValueExpression>

<Operator>IsNotNull</Operator>

</UnaryExpression>

</Expression>

</And>

</Expression>

</And>

</Expression>


<Expression>

<And>

<Expression>

<SimpleExpression>

<ValueExpression>

<Property
State=Pre>$Context/Property[Type=’SendEmail!IncidentSendMailExtension’]/Message$</Property>

</ValueExpression>

<Operator>NotEqual</Operator>

<ValueExpression>

<Property
State=Post>$Context/Property[Type=’SendEmail!IncidentSendMailExtension’]/Message$</Property>

</ValueExpression>

</SimpleExpression>

</Expression>

<Expression>

<SimpleExpression>

<ValueExpression>

<Property
State=Post>$Context/Property[Type=’SendEmail!IncidentSendMailExtension’]/MessageType$</Property>

</ValueExpression>

<Operator>Equal</Operator>

<ValueExpression>

<Value>{9f6d72ad-1bff-ca89-f619-8d50cd876576}</Value>

</ValueExpression>

</SimpleExpression>

</Expression>

</And>

</Expression>

</Or>

</Expression>

</Criteria>

The following has changed :

  • Added an Outer <Expression><Or>…. </Or></Expression>block to OR the following logical criteria together:
    • Message changes from IsNull to NotNull AND MessageType = some message type

      OR

  1. Message changes (Pre NotEqual Post) AND MessageType = some message type

Make sure to replace the GUID with your specific guid from above !!

  • Save the Mp and reimport.( Ignore the data loss message )



Okay ! Now let’s test !
Open an incident. Select the “Send Email” button and choose the correct template.


You’ll see the message attached to the action log.



Verify the execution of the workflow.

And verify the mail that the user recieves.


He hits reply and the answer is added to the incident. Make sure the ID is added to the subject in brackets […]



The incident is also put to active because of the template we selected in the exchange connector when “updating incident” applied.
Great feature and super work done by Travis.
I had some issues with the exchange autodiscovery service.

  1. The availability service url was incorrect in exchange ( pointing to /EWS in stead of /EWS/Exchange.asmx )

    This resulted in an error 405 ( Method Not Allowed ) in the connector.


  1. The exchange certificate was incorrect ( Netbios name in stead of FQDN )

    This resulted in an error 407 ( Proxy Authentication Required ) in the connector


Enjoy.
Gino D


Follow

Get every new post delivered to your Inbox.

Join 677 other followers