News in SCSM12 (Beta) #3 – Automation of Service Requests

In my last blog post I talked about the new Service Request Work Item type and how to use them. Service Requests are great, but it would be even cooler to automate the IT processes behind it. This is possible when you are using Service Manager 2012 together with System Center Orchestrator 2012. This product allows you to design runbooks to completely automate things. Those runbooks can be imported into Service Manager and then be used as “”Runbook Automation Activities” in Service Request Templates. This brings the automation of your infrastructure to the next level.

****************************************************
The complete SCSM SM12 (Beta) Series:
#1 – Service Level Objectives (SLO)
#2 – Service Requests
#3 – Automation of Service Requests
#4 – Enable Self-Service for Service Requests
#5 – Parent/Child Incidents
#6 – Release Management
#7 – Connectors
#8 – Permissions for triggering System Center Orchestrator runbooks
****************************************************

This blog post will guide you to the complete process of automating Service Requests with Service Manager. Now let’s start from the very beginning … and be prepared for a long post :)

Step 1 – Create runbooks

First, create a runbook that automates one of your processes. In this example I have created a very simple runbook to create new ADDS Users with System Center Orchestrator (SCO).

image

The first activity in the runbook defines the runbook parameters. These will later be used to create the User Accounts. The second activity is a Powershell script that uses the input from the first object to create the user in ADDS. In Orchestrator this is called “published data”.

image

image

When the runbook is started (e.g. with the “Runbook Tester”) we need to provide the parameter values, otherwise the runbook cannot run. The cool thing with this is, that you can design very dynamic runbooks using this technology.

image

Step 2 – Import runbooks into Service Manager

Service Manager 2012 brings a new “System Center Orchestrator Connector” that allows you to import runbooks and use them later in Activities and Service Requests. Let’s create a new runbook connector and get those runbooks.

image

We have to enter the URL of the SCO Web Service. Ask your SCO-Admin for this. Normally the URL in the following Screenshot is correct, but maybe in your environment the SCO Web Service is using another port. Also define a connection Account that enough rights to read runbooks from Orchestrator.

image

Now select the Folder that contains the runbooks that you want to import. In this example I import all runbooks that exist in SCO.

image

As a last information enter the URL of the SCO Web Console. This URL is later used to access more information about runbooks. Again, ask your SCO-Admin for details.

image

Now the connector is up and running. You can manually start a synchronization of the connector and should see the runbooks in the library after a few seconds.

image

Step 3 – Create Runbook Activity Templates

Now as the runbooks are available in Service Manager, we can create so-called “Runbook Automation Activity Templates”. Start the task from the task window to create such an activity for our SCO runbook that creates User Accounts in ADDS. Define a good Name for the Template.

image

image

Now you can configure the Runbook Automation Template and enter the needed values. In this example I only enter a Title and (very important) mark the option to automate the execution of this activity. In a more complex scenario some more configuration is needed here, but I will cover such scenarios in a later blog post. For now it’s OK to go like that.

image

Now save the template – that’s it. This activity template can now be used in a Service Request.

Step 4 – Create a Service Request Template

Now it’s time to create a Service Request template and use our new Runbook Automation Activity in it. I will not go into any details on how to create Service Requests as this can be read in my previous blog post here –> http://blog.scsmfaq.ch/2011/10/28/news-in-scsm12-beta-2-service-requests/.

Create a new Template and configure the desired values. Then add the activities as needed. You can now select the prepared Runbook Automation Activity and use it in your process.

image

image

Step 5 – Create a new Service Request

Now it’s time to test it! Create a new Service Request and use your template.

image

image

Enter the information you need. Then change to the activities tab and configure the Runbook Automation Activity. To create the user Account we need to provide some information that the runbook needs for execution. On the details of the runbook activity switch to the runbook tab and enter the appropriate information.

image

image

image

Now close the Service Request and check what happens. First, the Service Request will be shown in the list of Open Requests and have the Status “New”. After some seconds this will change to “In Progress”. Then the workflow engine follows your process defined in the Service Request.

image

As soon as the Runbook Automation Activity becomes active, the runbook is triggered in System Center Orchestrator. Check the System Center Orchestrator log of the runbook to see if it was triggered and if it was successful or not. In this example it looks pretty good.

image

At the end the Service Request should automatically change the status to “Completed” and – tho most important thing – the User Account should have been created in ADDS.

image

Wow, this is great! The new possibilities to connect Service Manager with System Center Orchestrator gives us complete new possibilities to drive automation to the next level and is a vital element in a private cloud strategy.

In this example there is only one downside: the process of creating a new Service Request and fill in the needed data is not very comfortable – and it has to be done by a technician using the Service Manager console. In the next blog post we will go one step further and bring our Service Request to the Service Catalog to offer it directly to the end users (or other consumers). This allows us to give the end users access to several Offerings they can access directly using a Web Portal. So make sure you don’t miss the next blog post!

regards
Marcel

This entry was posted in SCORCH, SCSM and tagged , , , , , , , , . Bookmark the permalink.

11 Responses to News in SCSM12 (Beta) #3 – Automation of Service Requests

  1. Marc says:

    very good blog entry.
    could you possibly publish a PowerShell script?

    greeting
    marc

    • Hey Marc

      Thanks! I can publish the script I used in the described example – find it below. The values for the variables are published data from the “Initialize Data” object. Because I cannot copy those, it may look a bit strange :) Keep in mind that dealing with Identity and Access Management (IAM) could be much more powerful by using Service Manager and Orchestrator together with FIM (Forefront Identity Manager).

      regards
      Marcel

      $givenname = “\`d.T.~Ed/{04A2A91F-5218-498A-B8DD-3837438712AE}.{5B2EA8E6-0AFB-41A7-96B7-8845BFE81341}\`d.T.~Ed/”
      $surname = “\`d.T.~Ed/{04A2A91F-5218-498A-B8DD-3837438712AE}.{83C9873C-3FA5-4A41-BFED-25EC25A03C69}\`d.T.~Ed/”
      $samaccountname = “\`d.T.~Ed/{04A2A91F-5218-498A-B8DD-3837438712AE}.{5E0FFC17-A0B2-4AF7-B8A4-F9539C138907}\`d.T.~Ed/”
      $upnprefix = “\`d.T.~Ed/{04A2A91F-5218-498A-B8DD-3837438712AE}.{8FF1A0F7-ABF1-4630-A08B-627F68C1FB62}\`d.T.~Ed/”
      $domainsuffix = “\`d.T.~Ed/{04A2A91F-5218-498A-B8DD-3837438712AE}.{4DB41C54-379F-4F03-AEF7-1C5A4F53B15F}\`d.T.~Ed/”
      $initials = “\`d.T.~Ed/{04A2A91F-5218-498A-B8DD-3837438712AE}.{3E621600-41F6-43B6-B7C2-E722F6F0F900}\`d.T.~Ed/”
      $title = “\`d.T.~Ed/{04A2A91F-5218-498A-B8DD-3837438712AE}.{1872EF3C-06CB-4A82-9859-8EA17C9794ED}\`d.T.~Ed/”
      $description = “\`d.T.~Ed/{04A2A91F-5218-498A-B8DD-3837438712AE}.{C5D965FA-0518-4E32-BA40-F7D38CD166A7}\`d.T.~Ed/”
      $accountpassword = “\`d.T.~Ed/{04A2A91F-5218-498A-B8DD-3837438712AE}.{194B3A75-C27E-49C8-BACB-53B3853A93AB}\`d.T.~Ed/”

      try
      {
      import-module activedirectory

      new-aduser -name ($surname + ” ” + $givenname) -givenname $givenname -surname $surname -displayname ($surname + ” ” + $givenname) -samaccountname $samaccountname -userprincipalname ($upnprefix + “@” + $domainsuffix) -initials $initials -title $title -description $description -accountpassword (ConvertTo-SecureString -AsPlainText “$accountpassword” -Force) -enabled:$true -ChangePasswordAtLogon:$true

      $errorlevel=0
      }

      catch
      {
      $errorlevel=1
      }

      • Joao says:

        Hello Marcel,
        I’ve been following your post this but I have a problem in Runbook, this is my first runbook, I never work with orchestrator.
        In the orchestrator when I do runbook tester I have this error when the script of AD create user runs:
        Unexpected token ‘Activity’ in expression or statement.

        Another question:
        My AD is on another server, I have to mention the location of my AD server in the Runbook?

        Can you please help me?
        regards.

      • Hey Joao

        Meanwhile the Active Directory Integration Pack for SCORCH has been released. Please try this for an easier approach.

        regards
        Marcel

  2. Pingback: News in SCSM12 (Beta) #4 – Enable Self Service for Service Requests | SCSMfaq.ch

  3. Pingback: News in SCSM12 (Beta) #2 – Service Requests | SCSMfaq.ch

  4. Pingback: News in SCSM12 (Beta) #1 – Service Level Objectives (SLO) | SCSMfaq.ch

  5. Pingback: News in SCSM12 (Beta) #6 – Release Management | SCSMfaq.ch

  6. Pingback: News in SCSM12 (Beta) #5 – Parent/Child Incidents | SCSMfaq.ch

  7. Pingback: News in SCSM12 (Beta) #7 – Connectors | SCSMfaq.ch

  8. Pingback: News in SCSM12 (Beta) #8 – Permissions for triggering System Center Orchestrator runbooks | SCSMfaq.ch

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