An Application Request with a lot of System Center Power via Orchestrator, ServiceMgr and ConfigMgr

As it Christmas, I wanted to do something special. That’s why dove into the world of ServiceMgr and came up with this long blog post about a combination of ConfigMgr, Orchestrator and ServiceMgr. This blog post will describe a configuration for a software request via the ServiceMgr Portal. I’m not going to say that I like the ServiceMgr Portal more than the Application Catalog of ConfigMgr, because I really don’t, but I do think it fits better within the processes of a company. Besides that, if it doesn’t fit, it can be customized.

High Level Overview

Like I stated the software request can be done via the ServiceMgr Portal. The portal will display applications that are imported, and after that filtered, via the ConfigMgr Connector. The user can request these applications via the portal. After the request is approved, an Orchestrator runbook will find the deployment collection in ConfigMgr, for the requested application, and will add the user to that collection.

ConfigMgr Assumptions

imageActually in this specific blog post there is not much to say about the configuration in ConfigMgr… There are only a few assumptions used to make everything work together:

  • The new application model is used.
  • The applications are deployed to users.
  • The users are added via direct membership rules to the collections.
  • There is only one deployment per application.

Note: This last assumption is a very important one, to make this blog post work. Of course it will also be possible to have multiple deployments, but in that case there has to be some filtering done via Orchestrator.

Orchestrator Runbook

The biggest and most important part of this blog post is the configuration in Orchestrator. The runbook is the key to this software request, as it has to connect all the information. It will get the requested application, the requesting user and the collection to which the application is deployed and in the end it will add the user to the collection. So I will describe all the activities, step-by-step, that I used to make this work. As a prerequisite for the following steps, both the System Center Integration Pack for System Center 2012 Configuration Manager and the System Center Integration Pack for System Center 2012 Service Manager need to be registered and deployed.AddUserToCollecction

  1. Open the Orchestrator Runbook Designer, create a new runbook and name it Add User to Collection.
  2. Add an Initialize Data –activity and double-click it. In the Details Information click Add and a new parameter named Parameter 1 will be added. Now click Parameter 1, change the name to ActivityGUID, click Ok and click Finish.
  3. Add a Get Relationship –activity, name it Get App Relationship, link it with the previous activity and double-click it. In the Details Information fill in the following Properties and click Finish:
    1. Connection: Select the ServiceMgr connection. 
    2. Object Class: Select Runbook Automation Activity.
    3. Object Guid: Right-click and select Subscribe > Published Data. In the Published Data –popup, select with Activity Initialize Data, select ActivityGUID, and click Ok.
    4. Related Class: Select Package.
  4. Add a Get Object –activity, name it Get App Object, link it with the previous activity and double-click it. In the Details Information fill in the following Properties and Filters and click Finish:
    1. Connection: Select the ServiceMgr connection. 
    2. Class: Select Package.
    3. Filters: Click Add. In the Filter Settings –popup, fill in the following Settings and click Finish:
      1. Name: Select SC Object Guid.
      2. Relation: Select Equals.
      3. Value: Right-click and select Subscribe > Published Data. In the Published Data –popup, select with Activity Get App Relationship, select Related Object Guid, and click Ok.
  5. Add a Get Relationship –activity, name it Get Parent SR Relationship, link it with the previous activity and double-click it. In the Details Information fill in the following Properties and click Finish:
    1. Connection: Select the ServiceMgr connection. 
    2. Object Class: Select Runbook Automation Activity.
    3. Object Guid: Right-click and select Subscribe > Published Data. In the Published Data –popup, select with Activity Initialize Data, select ActivityGUID, and click Ok.
    4. Related Class: Select Service Request.
  6. Add a Get Object –activity, name it Get SR Object, link it with the previous activity and double-click it. In the Details Information fill in the following Properties and Filters and click Finish:
    1. Connection: Select the ServiceMgr connection. 
    2. Class: Select Service Request.
    3. Filters: Click Add. In the Filter Settings –popup, fill in the following Settings and click Finish:
      1. Name: Select SC Object Guid.
      2. Relation: Select Equals.
      3. Value: Right-click and select Subscribe > Published Data. In the Published Data –popup, select with Activity Get Parent SR Relationship, select Related Object Guid, and click Ok.
  7. Add a Get Relationship –activity, name it Get User Relationship, link it with the previous activity and double-click it. In the Details Information fill in the following Properties and click Finish:
    1. Connection: Select the ServiceMgr connection. 
    2. Object Class: Select Service Request.
    3. Object Guid: Right-click and select Subscribe > Published Data. In the Published Data –popup, select with Activity Get SR Object, select SC Object Guid, and click Ok.
    4. Related Class: Select Active Directory User.
  8. Add a Get Object –activity, name it Get User Object, link it with the previous activity and double-click it. In the Details Information fill in the following Properties and Filters and click Finish:
    1. Connection: Select the ServiceMgr connection. 
    2. Class: Select Active Directory User.
    3. Filters: Click Add. In the Filter Settings –popup, fill in the following Settings and click Finish:
      1. Name: Select SC Object Guid.
      2. Relation: Select Equals.
      3. Value: Right-click and select Subscribe > Published Data. In the Published Data –popup, select with Activity Get User Relationship, select Related Object Guid, and click Ok.
  9. Double-click the link between Get User Relationship and Get User Object. In the Exclude Filters click Add. Click Get User Relationship and select Relationship Class, click equals and select does not equals and then click value, type Affected User and click Finish.
  10. Add a Run .NET Script –activity, name it Get Collection, link it with the previous activity and double-click it. In the Details Information fill in the following Type and Script and click Published Data:
    1. Type: Select PowerShell.
    2. Script: Add the following script and on right-click on REPLACE and select Subscribe > Published Data. In the Published Data –popup, select with Activity Get App Object, select Display Name, and click Ok:
      $SiteCode = "<SiteCode>" $SiteServer = "<SiteServer>" $CollectionId = (Get-WmiObject -Class SMS_DeploymentSummary -Namespace root/SMS/site_$($SiteCode) -ComputerName $SiteServer -Filter "SoftwareName='{REPLACE}'").CollectionId

    3. In the Published Data click Add. In the Published Data –popup fill in the following information and click Ok, followed by Finish.
      1. Name: Type CollectionId.
      2. Type: Select String.
      3. Variable name: Type CollectionId.
  11. Add a Add Collection Rule –activity, link it with the previous activity and double-click it. In the Details Information fill in the following Properties and click Finish:
    1. Connection: Select the ConfigMgr connection. 
    2. Collection: Right-click and select Subscribe > Published Data. In the Published Data –popup, select with Activity Get Collection, select CollectionId, and click Ok.
    3. Collection Value Type: Select ID.
    4. Rule Name: Right-click and select Subscribe > Published Data. In the Published Data –popup, select with Activity Get User Object, select Domain and type a “\”. Then again right-click and select Subscribe > Published Data. In the Published Data –popup, select with Activity Get User Object, select User Name, and click Ok.
    5. Rule Type: Select Direct Rule.
    6. Rule Definition: Right-click and select Subscribe > Published Data. In the Published Data –popup, select with Activity Get User Object, select Domain and type a “\”. Then again right-click and select Subscribe > Published Data. In the Published Data –popup, select with Activity Get User Object, select User Name, and click Ok.
    7. Rule Definition Value Type: Select Resource Names.
  12. Save the runbook by clicking Check In.

ServiceMgr Runbook Automation Activity Template

Now it’s time to make it possible to use the just created runbook within ServiceMgr. To do that it is necessary to create a Runbook Automation Actiivty Template. I will describe the most important steps and settings that are needed to be done. The details can be filled with everyone’s own healthy creativity. A prerequisite for the following steps is a working Orchestrator connector which synced the just created runbook into ServiceMgr.

  1. Open the Service Manager Console, navigate to Library > Runbooks, select the just created runbook named Add User to Collection and click on the task Create Runbook Automation Activity Template.
  2. AddUseToColRunTemOn the Create Template –popup, fill in as name Add User to Collection – Runbook Template, select (or create) an unsealed management pack, that will be used to save the template, click Ok and the Runbook Activity Template: Add User to Collection Runbook Template will show.
  3. On the General tab, use your creativity to fill in some information and make sure that Is Ready For Automation is selected.
  4. On the Runbook tab, select the Add User to Collection –runbook and change the Parameter Mapping of ActivityGUID to Object > Id.
  5. In case your creativity wants you to add some information on the Configuration Items –tab, the Scheduling –tab, or the Related Items –tab, do that now and click Ok.

ServiceMgr Request Template

After the Runbook Automation Activity is created, its is time to start using it within a request in ServiceMgr.

  1. In the Service Manager Console, navigate to Library > Templates and click on the task Create Template.
  2. ApplReqOn the Create Template –popup, fill in the following information click Ok and the Service Request Template will show.
    1. Name: Type Application Request – Request Template.
    2. Class: Select Service Request.
    3. Management pack: Select (or create) an unsealed management pack, that will be used to save the template.
  3. On the General tab, fill in as Title Application Request and use your creativity to fill in some more information.
  4. On the Activities tab, click Add (+) and in the Select Template –popup select Add User to Collection – Runbook Template. Now again use your creativity to add some more activities. For example, add an activity one for an approval.

ServiceMgr Request Offering

Now it’s time to start making this new Request Template available for the end-users. To do this, it is necessary to create a Request Offering. A prerequisite, for a Request Offering with a nice overview of applications, is a working ConfigMgr connector. To filter the imported applications I will use the Publish state of the imported Packages, so make sure that at least a few have Publish set to True

  1. In the Service Manager Console, navigate to Library > Service Catalog > Request Offerings and click on the task Create Request Offering and the Create Request Offering –wizard will show.
  2. On the Before You Begin page, click Next.
  3. On the General page, fill in the following information and click Next.
    1. Title: Type Application Request.
    2. Description: (Optional).
    3. Template name: Click Select Template and in the Select Template –popup select Application Request – Request Template.
    4. Management pack: Select (or create) an unsealed management pack, that will be used to save the template.
  4. On the User Prompts page, add as Form Instructions Please select and application, add at least the following prompt and click Next.
    1. User Prompts or Information: Type Application.
    2. Response Type: Select Required.
    3. Prompt Type: Select Query Results.
  5. ConfPromOn the Configure Prompts page, select Application and click Configure and the Configure Query Results –popup will show. Walk through the next steps and click Next.
    1. On the 1. Select Class page, select Package.
    2. On the 2. Configure Criteria (Optional) page, select Package > Publish and click Add Constraint.
    3. On the 3. Display Columns page, select Object > Display Name.
    4. On the 4. Options page, select Add user-select objects to template object as related items followed by Application Request – (Service Request), select Add user-selected objects to template object as affected configuration items followed by Add User to Collection – (Runbook Automation Activity) and click Ok.
  6. On the Map Prompts page, at least select Review Application Request – (Review Activity) followed by selecting Token: Portal User Name with Description and click Next.
  7. On the Knowledge Articles page, click Next.
  8. On the Publish page, select with Offering status Published and click Next.
  9. On the Summary page, click Create.
  10. On the Completion page, click Close.

Now the final action before the end-user can use this newly created request is adding the Request Offering to a Service Offering. A prerequisite for the following steps is that there is already a Service Offering created.

  1. In the Service Manager Console, navigate to Library > Service Catalog > Request Offerings > All Request Offerings, select the new Request Offering named Application Request and click on the task Add to Service Offering.
  2. On the Select objects –popup, select a Service Offering and click Ok.

The End Result

ApplReqPortNow it’s finally time to have look at the end result for the end-user. The end-user will go through a small form as shown here on the side. After the form is submitted, in my case, a Service Request will be started. That service request will first ask for an approval with a manager and after it’s been approved the runbook will start. The runbook will find the user, the application and the collection (to which the application is deployed) and in the end add the user to the collection. After the user is added to the collection it will get the application via ConfigMgr.

6 thoughts on “An Application Request with a lot of System Center Power via Orchestrator, ServiceMgr and ConfigMgr”

  1. Peter,
    I know it has been a long time since this blog, but I was wondering if you can answer a question.
    We are using SCCM v1602 (5.00.8355.1000) , and following your instructions it does not show a list of software. I have checked with my SCCM admin and he assures me that the assumptions at the beginning of the blog are true.

    Reply
    • Hi Karen,
      Apologies for the late reply. I haven’t tested it with the latest versions of the products. Based on the frameworks of the products, which haven’t changed much, I would think that it should still work.
      Peter

      Reply
  2. Dear Peter,
    I am also having the same problem as Karen. Its now showing me the list of published software. It would be great if you can help me out from this.

    And one more query, In this runbook we are adding user into collection and installing software for his machine, what about the scenario where single user is owning more than one machine?

    Reply
    • I would love to help. However, I’ve killed Service Manager a few years ago in my lab. In other words, I currently can’t reproduce this. I can only throw suggestions, like is the information flowing correctly to Service Manager?

      Reply

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.