+1 (866) 930-8356
Concurreny
Real Microsoft expertise. Real business value.

SCSM Notifications with Orchestrator and SMLets

I needed to get notifications to Service Manager end users working within my Orchestrator runbooks.  I needed this because I’ve been building a lot of comprehensive workflow solutions for Service Manager by leveraging the Orchestrator as the end-to-end workflow mechanism and in doing so I want to have as many components of that workflow encapsulated in the Orchestrator process as possible.  I didn’t want to build the workflow in Orchestrator and have the notifications setup as Service Manager subscriptions.

 

I went to build the workflow and added my “Get Object” activity from the Service Manager integration pack.  I however struggled to find the class that contains the notification addresses associated to a user.  I found that in order to get that information I needed to add the SMLets PowerShell commandlets. 

 

Here is what I needed to do:

 

First, download and install the SMLets on your Orchestrator server.

http://smlets.codeplex.com/releases/view/84853

 

You’ll need to do a little tinkering to get SMLets working.  Here is a walkthrough:

http://blog.scsmsolutions.com/2012/09/configure-smlets-beta-4-for-working-with-orchestrator/

 

In the workflow below we are monitoring for new activities which are created, then sending notifications to the assigned users using their primary SMTP address.  We could be providing additional filtering on the activities, but this will suffice for testing purposes.  You’ll see that it is a relatively simple workflow.

The first step is to get the new activity.

We then get the related user and filter the user based on the “Assigned to User”.  The previous step would have retrieved potentially multiple users, but by filtering we are able to ensure we only return the one we are looking for.

We then retrieve the user’s notification address by passing the SCObjectGUID into the retrieval of the user using SMLets and the related SMTP address. 

“Set-ExecutionPolicy RemoteSigned

Import-module smlets -Force

$AffectedUser = Get-SCSMObject -ID “Previous Step SCObjectGUID”

$endPoint = Get-SCSMRelatedObject -ComputerName INMS137 -SMObject $AffectedUser -Relationship $userPerf|?{$_.DisplayName -like ‘*SMTP’}

$email = $endPoint.TargetAddress”

 

We then follow-up with the sending of the actual email to the user.  We pass the property of email into the send email activity.

Happy notifying!

Nathan Lasnoski

 
 

Nathan Lasnoski is the Director of Concurrency’s Infrastructure Practice, a Datacenter MVP and a recognized leader in Core Infrastructure Design, SharePoint Infrastructure, Virtualization, and Unified Communications technologies.

Find Nathan on: Linkedin Twitter

 
  • hamza

    Hi Nathan,

    Thank you for this post. Can you explain me what means this line “Relationship $userPerf|?{$_.DisplayName -like ‘*SMTP’….

  • hamza

    Hi Nathan,

    Thank you for this post. Can you explain me what means this line “Relationship $userPerf|?{$_.DisplayName -like ‘*SMTP’….

    • Willem

      When you type “Alias ?” in a powershell window you can see the “?” is linked to “Where-object”. It’s just a quick way of using the command without typing the entire method.

      Basically he’s just calling up the values of the variable “$userPerf” and doing a “Where-object” filter with certain criteria.

  • ozge

    Is it possible to create a runbook based on manual activity implementer assignment-reassignment?

    • disqus_cufydpQ0gF

      You can for service requests for sure. For activities you might need to grab it from the history to trigger it.

      • ozge

        How can I monitor history? In history, I can only see new “first assigned date” entry and “Relationship changes: Assigned To User ” when the assignment changes.

Categories