MEMOEXP

Our System Center Memo

SCSM Approve by Email

With the Exchange Connector, approvers can approve a SR using emails. But it still require them to key in a specific keyword. Let’s be honest, how many managers will actually do that, or knows how to do that? Many of them are end users. Here’s what we can do to help them.

I’m using SCO to accomplish this though, you can try to modify the script a bit to make it fit into SCSM Notification Templates. Skip right to step 10 if all you need is the HTML script, or follow through if you need a more step to step guide. I’m assuming you know the basics of SCO, if not let me know and I’ll help you personally.

  1. This is how my Runbook looks like.
     image
  2. These are the data that I require so I will need to get it. If you already know how, skip this part. If not you can refer to my other post here to see how I got the info.
    image
  3. First we need to find out who is the Reviewer. You can do it by following the steps below.
    image
  4. Next we need to find out more information about the Reviewer. Do this.
    image
  5. The next part is to get the Email of the Reviewer. Paste the following script into the Details tab.
    image

    $Session = New-PSSession -ComputerName ‘YOUR SERVER NAME
    $Email = Invoke-Command -Session $Session -scriptblock{

    Import-Module SMLets
    $SID = "\`d.T.~Ed/{141E367C-147B-4752-9FDF-DC983B1059BD}.SCObjectGuid\`d.T.~Ed/"
    $Reviewer = Get-SCSMObject -ID $SID
    $endPoint = Get-SCSMRelatedObject -SMObject $Reviewer -Relationship $userPerf|?{$_.DisplayName -like ‘*SMTP’}

    $email = $endPoint.TargetAddress
    Remove-PSSession $Session
    $email
    Remove-Module SMlets -Force
    }

  6. At the Published Data tab, create the following.
    image 
  7. On the Get RA activity, this is what we need to do. The reason I’m pulling data from here is so that I can provide more information in the email. Skip this step if you don’t require it.
    image
  8. Next I want to find out the SR number and details. On the Find SR activity, do this.
    image
  9. On the Get SR activity, follow this. Again like step 7, I’m doing this step is because I want more information to be available when I send the email out.
    image
  10. Now we have gotten all the information we require, this is what we need to do at the Send Email activity. I’m assuming you know what to do on the Subject and Recipient, so I’m going straight to the point of this blog post, which is the Message part. Post the following script there.
    image 

    I’ve bolded the place you need to change. Spot the 2 YOUR EXCHANGE CONNECTOR EMAIL below? Please replace that with your exchange connector mailbox address.

    <html>
    <style>
    .button-link {
        padding: 10px 15px;
        background: #4479BA;
        color: #FFF;
        -webkit-border-radius: 4px;
        -moz-border-radius: 4px;
        border-radius: 4px;
        border: solid 1px #20538D;
        text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.4);
        -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 1px 1px rgba(0, 0, 0, 0.2);
        -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 1px 1px rgba(0, 0, 0, 0.2);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 1px 1px rgba(0, 0, 0, 0.2);

    }
    a:link {text-decoration:none;}
    a:visited {text-decoration:none;}
    a:hover {text-decoration:none;}
    a:active {text-decoration:none;}
    </style>
    <body>

    <br>Dear \`d.T.~Ed/{DAF11E13-864B-4540-B9B0-7F73397489F4}.DisplayName\`d.T.~Ed/,<br><br>

    Please be informed that a Service Request has been raised by your staff and is awaiting your approval. Following are the additional details:<br><br>

    <table>
    <tr>
      <td width=210>
      <p><b>Activity ID</b></p>
      </td>
      <td>
      <p>: \`d.T.~Ed/{8B51B658-14FF-4852-993C-DC3D4A21268E}.Id\`d.T.~Ed/</p>
      </td>
    </tr>
    <tr>
      <td width=210>
      <p><b>Service Request ID</b></p>
      </td>
      <td>
      <p>: \`d.T.~Ed/{1AF2A8A7-8BB5-4096-AD60-16D1D064EF3C}.Id\`d.T.~Ed/</p>
      </td>
    </tr>
    <tr>
      <td width=210>
      <p><b>Requestor</b></p>
      </td>
      <td>
      <p>: \`d.T.~Ed/{5447702A-F39E-4844-BF45-48249C232532}.DisplayName\`d.T.~Ed/</p>
      </td>
    </tr>
      <td width=210>
      <p><b>Service Request Title</b></p>
      </td>
      <td>
      <p>: \`d.T.~Ed/{1AF2A8A7-8BB5-4096-AD60-16D1D064EF3C}.Title\`d.T.~Ed/</p>
      </td>
    </tr>
    <tr>
      <td width=210>
      <p><b>Service Request Description</b></p>
      </td>
      <td>
      <p> <pre style ="margin-top: 0px; font-family:Arial,Helvetica,sans-serif; font-size:16px;"> \`d.T.~Ed/{1AF2A8A7-8BB5-4096-AD60-16D1D064EF3C}.Description\`d.T.~Ed/</pre></p>
      </td>
    </tr>
    </table>

    <br>
    <table class=MsoTableGrid border=1 cellspacing=0 cellpadding=0 align=left
    style=’background:#4472C4;mso-background-themecolor:accent5;border-collapse:collapse;border:none;mso-border-alt:solid windowtext .5pt;
    mso-table-overlap:never;mso-yfti-tbllook:1184;mso-table-lspace:9.0pt;
    margin-left:6.75pt;mso-table-rspace:9.0pt;margin-right:6.75pt;mso-table-anchor-vertical:
    paragraph;mso-table-anchor-horizontal:column;mso-table-left:left;mso-table-top:
    .05pt;mso-padding-alt:0cm 5.4pt 0cm 5.4pt’>
    <tr style=’mso-yfti-irow:0;mso-yfti-firstrow:yes;mso-yfti-lastrow:yes’>
      <td width=95 valign=top style=’width:70.9pt;border:solid windowtext 1.0pt;
      mso-border-alt:solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt’>
      <p class=MsoNormal align=center style=’margin-bottom:0cm;margin-bottom:.0001pt;
      text-align:center;line-height:normal;mso-element:frame;mso-element-frame-hspace:
      9.0pt;mso-element-wrap:around;mso-element-anchor-vertical:paragraph;
      mso-element-anchor-horizontal:column;mso-element-top:.05pt;mso-height-rule:
      exactly’><a style=’display:block’
      title="Click here to Approve" href="mailto:YOUR EXCHANGE CONNECTOR EMAIL?subject=[\`d.T.~Ed/{8B51B658-14FF-4852-993C-DC3D4A21268E}.Id\`d.T.~Ed/]&body=[Approved] Approved by email"><span style=’color:white;
      mso-themecolor:background1;text-decoration:none;text-underline:none’>Approve</span></a></p>
      </td>
    </tr>
    </table>
    <table class=MsoTableGrid border=1 cellspacing=0 cellpadding=0
    style=’background:#4472C4;mso-background-themecolor:accent5;border-collapse:
    collapse;border:none;mso-border-alt:solid windowtext .5pt;mso-yfti-tbllook:
    1184;mso-padding-alt:0cm 5.4pt 0cm 5.4pt’>
    <tr style=’mso-yfti-irow:0;mso-yfti-firstrow:yes;mso-yfti-lastrow:yes’>
      <td width=94 valign=top style=’width:70.5pt;border:solid windowtext 1.0pt;
      mso-border-alt:solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt’>
      <p class=MsoNormal align=center style=’text-align:center’><span
      style=’color:white;mso-themecolor:background1′><a style=’display:block’
      title="Click here to Reject" href="mailto:YOUR EXCHANGE CONNECTOR EMAIL?subject=[\`d.T.~Ed/{8B51B658-14FF-4852-993C-DC3D4A21268E}.Id\`d.T.~Ed/]&body=[Rejected] Rejected by email"><span style=’color:white;
      mso-themecolor:background1;text-decoration:none;text-underline:none’>Reject</span></a><o:p></o:p></span></p>
      </td>
    </tr>
    </table>
    <br>

    Thank You<br>
    Service Desk<br>
    <br>

    NOTE: This is an automated e-mail generated by System Center Service Manager. Please do not reply to this email. If you need further assistance and/or clarification, please contact Service Desk.
    </div></body>

    </html>

  11. The end result of this? 2 nice little buttons at the bottom that your approvers can click to either Approve or Reject the request.
    image

    I’ve white out the contents of this email, but the point is the 2 buttons below. When they click the buttons, it will open out a New Email page that they can key in their comments, or if they choose to, simply just click Send, and Exchange Connector will do the rest.

     

Advertisements

July 18, 2014 - Posted by | System Center Orchestrator (SCO), System Center Service Manager (SCSM)

No comments yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: