次の方法で共有


Managing Configuration Manager Collections using the Service Manager Self-Service Portal

This post is the 6th in a series focused on making common administrative tasks in System Center and Azure available via the Service Manager Self-Service Portal. The Configuration Manager and Operations Manager Connectors pull a lot of information into Service Manager but not everything necessary to manage clients, agents, and other settings. This solution allows for the managing of Configuration Manager Collections including Creating and Deleting them from Configuration Manager.

Series

Using the Service Manager Self-Service Portal for Common Tasks in Configuration Manager, Operations Manager, and Azure

Prerequisites

The scenarios were designed using the following

  • System Center Service Manager 2012 R2
    • Self-Service Portal configured and working
    • Active Directory Connector configured and working
    • Configuration Manager Connector configured and working
    • Orchestrator Connector configured and working
  • System Center Configuration Manager 2012 R2
    • Discovery configured and working
  • System Center Orchestrator 2012 R2
    • SC 2012 Configuration Manager Integration Pack configured and working
    • SC 2012 Service Manager Integration Pack configured and working
    • Configuration Manager Console installed on runbook servers (open the console, make sure you can connect to your site server)
    • Operations Manager Console installed on runbook servers
    • Service Manager Console installed on runbook servers
    • Runbook servers configured to allow PowerShell scripts to run
  • Previous Blogs
    • Sync Configuration Manager Client and Operations Manager Agent State in Service Manager

Create a service account or use the one created in the previous blog post

  1. Give the account admin rights to Service Manager
  2. Give the account admin rights to Configuration Manager
  3. Give the account admin rights to Operations Manager

Create OUs for Scenario

These OUs will be used for this scenario only. In a production environment this solution would need to be customized to fit into your situation.

  1. Create a new OU called "Branch Locations" in the root of your domain
  2. Create 4 new OUs under Branch Locations called Dallas, Seattle, Fargo, and Charlotte

Populate OUs for Scenario

These OUs can be populated with both real and fake machines just for testing purposes only.

  1. Place real machines in at least several of the OUs
  2. You can also create fake machines using the "NewADComputer" script
 $i = 1
While ($i -lt 11)
{
  $name = “SeattleWin8-{0}” -f $i
  New-ADcomputer –name $name –SamAccountName $name -Path "OU=Seattle,OU=Branch Locations,DC=Contoso,DC=com" -OperatingSystem 'Windows 8.1 Enterprise' -OperatingSystemVersion '6.3 (9600)' -DNSHostName ("{0}.contoso.com" -f $name)
  Add-DnsServerResourceRecordA -ComputerName "dc01" -Name $name -ZoneName "contoso.com" -IPv4Address "192.168.1.1"
  $i++
}

* Ensure Configuration Manager is discovering these machines

Create Limiting Collections in Configuration Manager

This scenario uses a combination of Service Manager Groups, Management Pack Enumerations, and Configuration Manager Limiting Collections to restrict what collections can be created via the Service Manager Portal. There are many different ways to configure this, this is simply an example of one way.

  • Open the Configuration Manager Console
  • Go under "Assets and Compliance\Device Collections"
  • Create a new device collection called "Locations" limited to "All Systems" and including "All Systems"
  • Create 4 new device collections limited to "Locations" called Dallas, Seattle, Fargo, and Charlotte.
  • For the collections named after cities, you can add criteria. I am basing it on Organizational Units which contain the systems at each location:

clip_image001

  • All collections created via the portal will be limited to one of the 4 city collections in this example.

Import the Service Request Extended Management Pack into Service Manager

This Management Pack contains a class that extends System.WorkItem.ServiceRequest class so that it includes properties for Configuration Manager Collections. It also includes Enumerations used for Limiting Collections. This design isn't required and is just part of this scenario, but this enumeration is later as limiting collections.

  1. Open the Service Manager Console
  2. Select Administration
  3. Right-Click Management Packs and select Import
  4. Select the Custom.Example.DataCenter.Automation.ServiceRequestExtended.mp management pack and choose Open, Import, and OK
 <?xml version="1.0" encoding="utf-8"?>
<ManagementPack SchemaVersion="2.0" ContentReadable="true" xmlns:xsd="https://www.w3.org/2001/XMLSchema">
  <Manifest>
    <Identity>
      <ID>Custom.Example.DataCenter.Automation.ServiceRequestExtended</ID>
      <Version>1.0.0.4</Version>
    </Identity>
    <Name>DataCenter Automation: Service Request Extended</Name>
    <References>
      <Reference Alias="System">
        <ID>System.Library</ID>
        <Version>7.5.8501.0</Version>
        <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
      </Reference>
      <Reference Alias="SWSR">
        <ID>System.WorkItem.ServiceRequest.Library</ID>
        <Version>7.5.3079.0</Version>
        <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
      </Reference>
    </References>
  </Manifest>
  <TypeDefinitions>
    <EntityTypes>
      <ClassTypes>
        <ClassType ID="Custom.Example.DataCenter.Automation.ServiceRequestExtended.SystemWorkItemServiceRequestExtended" Base="SWSR!System.WorkItem.ServiceRequest" Extension="true" Accessibility="Public" Abstract="false" Hosted="false" Singleton="false">
          <Property ID="Location" Type="enum" AutoIncrement="false" Key="false" CaseSensitive="false" MaxLength="256" MinLength="0" Required="false" Scale="0" EnumType="Custom.Example.DataCenter.Automation.ServiceRequestExtended.Enum.Location" />
          <Property ID="CollectionAction" Type="enum" AutoIncrement="false" Key="false" CaseSensitive="false" MaxLength="256" MinLength="0" Required="false" Scale="0" EnumType="Custom.Example.DataCenter.Automation.ServiceRequestExtended.Enum.CollectionAction" />
          <Property ID="CollectionType" Type="enum" AutoIncrement="false" Key="false" CaseSensitive="false" MaxLength="256" MinLength="0" Required="false" Scale="0" EnumType="Custom.Example.DataCenter.Automation.ServiceRequestExtended.Enum.CollectionType" />
          <Property ID="CollectionName" Type="string" AutoIncrement="false" Key="false" CaseSensitive="false" MaxLength="256" MinLength="0" Required="false" Scale="0" />
          <Property ID="CollectionID" Type="string" AutoIncrement="false" Key="false" CaseSensitive="false" MaxLength="256" MinLength="0" Required="false" Scale="0" />
          <Property ID="LimitingCollectionName" Type="string" AutoIncrement="false" Key="false" CaseSensitive="false" MaxLength="256" MinLength="0" Required="false" Scale="0" />
        </ClassType>
      </ClassTypes>
      <EnumerationTypes>
        <EnumerationValue ID="Custom.Example.DataCenter.Automation.ServiceRequestExtended.Enum.Location" Accessibility="Public" />
        <EnumerationValue ID="Custom.Example.DataCenter.Automation.ServiceRequestExtended.Enum.Location.Charlotte" Accessibility="Public" Parent="Custom.Example.DataCenter.Automation.ServiceRequestExtended.Enum.Location" />
        <EnumerationValue ID="Custom.Example.DataCenter.Automation.ServiceRequestExtended.Enum.Location.Dallas" Accessibility="Public" Parent="Custom.Example.DataCenter.Automation.ServiceRequestExtended.Enum.Location" />
        <EnumerationValue ID="Custom.Example.DataCenter.Automation.ServiceRequestExtended.Enum.Location.Fargo" Accessibility="Public" Parent="Custom.Example.DataCenter.Automation.ServiceRequestExtended.Enum.Location" />
        <EnumerationValue ID="Custom.Example.DataCenter.Automation.ServiceRequestExtended.Enum.Location.Seattle" Accessibility="Public" Parent="Custom.Example.DataCenter.Automation.ServiceRequestExtended.Enum.Location" />
        <EnumerationValue ID="Custom.Example.DataCenter.Automation.ServiceRequestExtended.Enum.CollectionAction" Accessibility="Public" />
        <EnumerationValue ID="Custom.Example.DataCenter.Automation.ServiceRequestExtended.Enum.CollectionAction.Create" Accessibility="Public" Parent="Custom.Example.DataCenter.Automation.ServiceRequestExtended.Enum.CollectionAction" />
        <EnumerationValue ID="Custom.Example.DataCenter.Automation.ServiceRequestExtended.Enum.CollectionAction.Delete" Accessibility="Public" Parent="Custom.Example.DataCenter.Automation.ServiceRequestExtended.Enum.CollectionAction" />
        <EnumerationValue ID="Custom.Example.DataCenter.Automation.ServiceRequestExtended.Enum.CollectionType" Accessibility="Public" />
        <EnumerationValue ID="Custom.Example.DataCenter.Automation.ServiceRequestExtended.Enum.CollectionType.Device" Accessibility="Public" Parent="Custom.Example.DataCenter.Automation.ServiceRequestExtended.Enum.CollectionType" />
        <EnumerationValue ID="Custom.Example.DataCenter.Automation.ServiceRequestExtended.Enum.CollectionType.User" Accessibility="Public" Parent="Custom.Example.DataCenter.Automation.ServiceRequestExtended.Enum.CollectionType" />
      </EnumerationTypes>
    </EntityTypes>
  </TypeDefinitions>
  <Categories>
    <Category ID="Custom.Example.DataCenter.Automation.ServiceRequestExtended.Category.Location" Target="Custom.Example.DataCenter.Automation.ServiceRequestExtended.Enum.Location" Value="System!VisibleToUser" />
    <Category ID="Custom.Example.DataCenter.Automation.ServiceRequestExtended.Category.CollectionAction" Target="Custom.Example.DataCenter.Automation.ServiceRequestExtended.Enum.CollectionAction" Value="System!VisibleToUser" />
    <Category ID="Custom.Example.DataCenter.Automation.ServiceRequestExtended.Category.CollectionType" Target="Custom.Example.DataCenter.Automation.ServiceRequestExtended.Enum.CollectionType" Value="System!VisibleToUser" />
  </Categories>
  <LanguagePacks>
    <LanguagePack ID="ENU" IsDefault="true">
      <DisplayStrings>
        <DisplayString ElementID="Custom.Example.DataCenter.Automation.ServiceRequestExtended">
          <Name>DataCenter Automation: Service Request Extended</Name>
          <Description>Management Pack for extending Service Requests in Service Manager</Description>
        </DisplayString>
        <DisplayString ElementID="Custom.Example.DataCenter.Automation.ServiceRequestExtended.SystemWorkItemServiceRequestExtended">
          <Name>Service Request Extended</Name>
        </DisplayString>
        <DisplayString ElementID="Custom.Example.DataCenter.Automation.ServiceRequestExtended.SystemWorkItemServiceRequestExtended" SubElementID="Location">
          <Name>Location</Name>
        </DisplayString>
        <DisplayString ElementID="Custom.Example.DataCenter.Automation.ServiceRequestExtended.Enum.Location">
          <Name>Office Location</Name>
        </DisplayString>
        <DisplayString ElementID="Custom.Example.DataCenter.Automation.ServiceRequestExtended.Enum.Location.Charlotte">
          <Name>Charlotte</Name>
        </DisplayString>
        <DisplayString ElementID="Custom.Example.DataCenter.Automation.ServiceRequestExtended.Enum.Location.Dallas">
          <Name>Dallas</Name>
        </DisplayString>
        <DisplayString ElementID="Custom.Example.DataCenter.Automation.ServiceRequestExtended.Enum.Location.Fargo">
          <Name>Fargo</Name>
        </DisplayString>
        <DisplayString ElementID="Custom.Example.DataCenter.Automation.ServiceRequestExtended.Enum.Location.Seattle">
          <Name>Seattle</Name>
        </DisplayString>
        <DisplayString ElementID="Custom.Example.DataCenter.Automation.ServiceRequestExtended.SystemWorkItemServiceRequestExtended" SubElementID="CollectionAction">
          <Name>CollectionAction</Name>
        </DisplayString>
        <DisplayString ElementID="Custom.Example.DataCenter.Automation.ServiceRequestExtended.Enum.CollectionAction">
          <Name>Action</Name>
        </DisplayString>
        <DisplayString ElementID="Custom.Example.DataCenter.Automation.ServiceRequestExtended.Enum.CollectionAction.Create">
          <Name>Create Collection</Name>
        </DisplayString>
        <DisplayString ElementID="Custom.Example.DataCenter.Automation.ServiceRequestExtended.Enum.CollectionAction.Delete">
          <Name>Delete Collection</Name>
        </DisplayString>
        <DisplayString ElementID="Custom.Example.DataCenter.Automation.ServiceRequestExtended.SystemWorkItemServiceRequestExtended" SubElementID="CollectionName">
          <Name>CollectionName</Name>
        </DisplayString>
        <DisplayString ElementID="Custom.Example.DataCenter.Automation.ServiceRequestExtended.SystemWorkItemServiceRequestExtended" SubElementID="CollectionID">
          <Name>CollectionID</Name>
        </DisplayString>
        <DisplayString ElementID="Custom.Example.DataCenter.Automation.ServiceRequestExtended.SystemWorkItemServiceRequestExtended" SubElementID="CollectionType">
          <Name>CollectionType</Name>
        </DisplayString>
        <DisplayString ElementID="Custom.Example.DataCenter.Automation.ServiceRequestExtended.Enum.CollectionType">
          <Name>Type</Name>
        </DisplayString>
        <DisplayString ElementID="Custom.Example.DataCenter.Automation.ServiceRequestExtended.Enum.CollectionType.Device">
          <Name>Device</Name>
        </DisplayString>
        <DisplayString ElementID="Custom.Example.DataCenter.Automation.ServiceRequestExtended.Enum.CollectionType.User">
          <Name>User</Name>
        </DisplayString>
        <DisplayString ElementID="Custom.Example.DataCenter.Automation.ServiceRequestExtended.SystemWorkItemServiceRequestExtended" SubElementID="LimitingCollectionName">
          <Name>LimitingCollectionName</Name>
        </DisplayString>
      </DisplayStrings>
      <KnowledgeArticles></KnowledgeArticles>
    </LanguagePack>
  </LanguagePacks>
</ManagementPack>

Create the Create Collection Runbook

This Runbook will create collections in Configuration Manager, trigger the Sync Collections runbook created previously, and finally update the Description in the Service Request with the result of the Sync collections runbook.

  • Open the Orchestrator Runbook Designer
  • Create a new runbook
  • Drag the "Runbook Control\Initialize Data" activity into the new runbook
  • Rename it to "Get Runbook GUID"
  • Create a new string parameter under "Details" called RunbookID, and click "Finish"
  • Drag the "SC 2012 Service Manager\Get Object" activity into the new runbook
  • Rename it to "Get Runbook Object"
  • Fill out the following properties under "Details"
    • Connection: <Your Service Manager Connection>
    • Class: Runbook Automation Activity
    • Filters: SC Object Guid Equals {RunbookID from "Get Runbook GUID"

clip_image002

  • Click "Finish" and link "Get Runbook GUID" to "Get Runbook Object"
  • Drag the "SC 2012 Service Manager\Get Relationship" activity into the new runbook
  • Rename it to "Get SR GUID"
  • Link "Get Runbook Object" to "Get SR GUID"
  • Fill out the following properties under "Details"
    • Connection: <Your Service Manager Connection>
    • Object Class: Runbook Automation Activity
    • Object Guid: {SC Object Guid from "Get Runbook Object"}
    • Related Class: Service Request

clip_image003

  • Click "Finish"
  • Drag the "SC 2012 Service Manager\Get Object" activity into the new runbook
  • Rename it to "Get Service Request"
  • Link "Get SR GUID" to "Get Service Request"
  • Fill out the following properties under "Details"
    • Connection: <Your Service Manager Connection>
    • Class: Service Request Extended
    • Filters: SC Object GUID Equals {Related Object Guid from "Get SR GUID"}

clip_image004

  • Click "Finish"

  • Drag the "SC 2012 Configuration Manager\Create Collection" activity into the new runbook

  • Rename it to "Create Collection in CM"

  • Link "Get Service Request" to "Create Collection in CM"

  • Set the following properties on the "Create Collection in CM" activity

    • Connection Name: <Your connection to CM>
    • Collection Name: {Location from "Get Service Request"} - {CollectionName from "Get Service Request"}
    • Collection Type: {CollectionType from "Get Service Request"}
    • Limiting Collection: {Location from "Get Service Request"}
    • Limiting Collection Value Type: Name
    • Comment: Portal Generated Collection
    • Use Incremental Updates: False
  • Click "Finish"

  • Drag the "Runbook Control\Invoke Runbook" activity into the new runbook

  • Rename it to "Create Collection in SM"

  • Link "Create Collection in CM" to "Create Collection in SM"

  • Set the following properties on the "Create Collection in SM" activity

    • Runbook: <Sync Collections runbook created previously>
    • ServiceRequest: {ID from "Get Service Request"}
    • CollectionName: {Collection Name from "Create Collection in CM"}
    • Ensure "Wait for completion" is checked
  • Click "Finish"

  • Drag the "Text File Management\Find Text" activity into the new runbook

  • Rename it to "Get Script Result"

  • Link "Create Collection in SM" to "Get Script Result"

  • Fill out the following properties under "Details"

    • File: <local sharepath>\Automation\Logs\SRLogs\{ID from "Get Service Request"}.log
    • File encoding: Auto
    • Search text: Info:Script Complete, Result:

clip_image005

  • Click "Finish"
  • Drag the "SC 2012 Service Manager\Update Object" activity into the new runbook
  • Rename it to "Update Description of Service Request"
  • Fill out the following properties under "Details"
    • Connection: <Your Service Manager Connection>
    • Class: Service Request
    • Object Guid: {SC Object Guid from "Get Service Request"}
    • Fields: Description {Original line from "Get Script Result"} CMTrace Log File: {File path from "Get Script Result"}

clip_image006

  • Click "Finish" and link "Get Script Result" to "Update Description of Service Request"
  • Check in the Runbook, it should look similar to this:

clip_image007

Create the Delete Collection Runbook

This Runbook will delete collections in Configuration Manager, trigger the Sync Collections runbook created previously, and finally update the Description in the Service Request with the result of the Sync collections runbook.

  • Open the Orchestrator Runbook Designer
  • Create a new runbook
  • Drag the "Runbook Control\Initialize Data" activity into the new runbook
  • Rename it to "Get Runbook GUID"
  • Create a new string parameter under "Details" called RunbookID, and click "Finish"
  • Drag the "SC 2012 Service Manager\Get Object" activity into the new runbook
  • Rename it to "Get Runbook Object"
  • Fill out the following properties under "Details"
    • Connection: <Your Service Manager Connection>
    • Class: Runbook Automation Activity
    • Filters: SC Object Guid Equals {RunbookID from "Get Runbook GUID"

clip_image002[1]

  • Click "Finish" and link "Get Runbook GUID" to "Get Runbook Object"
  • Drag the "SC 2012 Service Manager\Get Relationship" activity into the new runbook
  • Rename it to "Get SR GUID"
  • Link "Get Runbook Object" to "Get SR GUID"
  • Fill out the following properties under "Details"
    • Connection: <Your Service Manager Connection>
    • Object Class: Runbook Automation Activity
    • Object Guid: {SC Object Guid from "Get Runbook Object"}
    • Related Class: Service Request

clip_image003[1]

  • Click "Finish"
  • Drag the "SC 2012 Service Manager\Get Object" activity into the new runbook
  • Rename it to "Get Service Request"
  • Link "Get SR GUID" to "Get Service Request"
  • Fill out the following properties under "Details"
    • Connection: <Your Service Manager Connection>
    • Class: Service Request
    • Filters: SC Object GUID Equals {Related Object Guid from "Get SR GUID"}

clip_image004[1]

  • Click "Finish"
  • Drag the "Utilities\Query XML" activity into the new runbook
  • Rename it to "Get User Input"
  • Link "Get Service Request" to "Get User Input"
  • Fill out the following properties under "Details"
    • XML Text: {User Input from "Get Service Request"}
    • Xpath Query: /UserInputs/UserInput[@Question='Collections']/@Answer

clip_image008

  • Click "Finish"
  • Drag the "Utilities\Query XML" activity into the new runbook
  • Rename it to "Get Collection Name"
  • Link "Get User Input" to "Get Collection Name"
  • Fill out the following properties under "Details"
    • XML Text: {Query result from "Get User Input"}
    • Xpath Query: //@DisplayName

clip_image009

  • Click "Finish"
  • Drag the "SC 2012 Configuration Manager\Delete Collection" activity into the new runbook
  • Rename it to "Delete Collection in CM"
  • Link "Get Collection Name" to "Delete Collection in CM"
  • Fill out the following properties under "Details"
    • Connection Name: <Your CM Connection>
    • Collection: {Query result from "Get Collection Name"}
    • Collection Value Type: Name
    • Delete members from database: False

clip_image010

  • Click "Finish"

  • Drag the "Runbook Control\Invoke Runbook" activity into the new runbook

  • Rename it to "Delete Collection in SM"

  • Link "Delete Collection in CM" to "Delete Collection in SM"

  • Set the following properties on the "Delete Collection in SM" activity

    • Runbook: <Sync Collections runbook created previously>
    • ServiceRequest: {ID from "Get Service Request"}
    • CollectionName: {Collection from "Delete Collection in CM"}
    • Ensure "Wait for completion" is checked
  • Click "Finish"

  • Drag the "Text File Management\Find Text" activity into the new runbook

  • Rename it to "Get Script Result"

  • Link "Create Collection in SM" to "Get Script Result"

  • Fill out the following properties under "Details"

    • File: <local sharepath>\Automation\Logs\SRLogs\{ID from "Get Service Request"}.log
    • File encoding: Auto
    • Search text: Info:Script Complete, Result:

clip_image005[1]

  • Click "Finish"
  • Drag the "SC 2012 Service Manager\Update Object" activity into the new runbook
  • Rename it to "Update Description of Service Request"
  • Fill out the following properties under "Details"
    • Connection: <Your Service Manager Connection>
    • Class: Service Request
    • Object Guid: {SC Object Guid from "Get Service Request"}
    • Fields: Description {Original line from "Get Script Result"} CMTrace Log File: {File path from "Get Script Result"}

clip_image006[1]

  • Click "Finish" and link "Get Script Result" to "Update Description of Service Request"
  • Check in the Runbook, it should look similar to this:

clip_image011

Create Runbook Automation Activity Template for the Create Collection Runbook

The Runbook Automation Activity Template will be link the Runbook we just created to a Service Request that we will be created later.

  1. Open the Service Manager Console
  2. Go to Administration\Connectors and Synchronize your Orchestrator Runbook Connector
  3. Go to Library\Templates and click "Create Template"
    • Name: Create Collection RAA Template

    • Description: Create CM Collection RAA Template

    • Class: Runbook Automation Activity

    • Management Pack: Click "New"

      • Name: DataCenter Automation: Configuration Manager Collections UI
      • Description: Configuration Manager Collections Templates and Offerings
    • Click OK, the Runbook Activity Form should appear. Check "Is Ready For Automation"

      • Title: Create Collection RA
      • Description: Create CM Collection RA
      • Click the "Runbook" Tab
      • Click "Select" and choose the Runbook created earlier
      • Click "Edit Mapping" and choose "Object\Id"
      • Click "OK"

Create Service Request Template for the Create Collection Runbook

The Service Request Template is needed to create a Request Offering using the Runbook Activity Template created previously

  1. Open the Service Manager Console
  2. Go to Library\Templates and click "Create Template"
    • Name: Create Collection SR Template
    • Description: Create CM Collection SR Template
    • Class: Service Request
    • Management Pack: DataCenter Automation: Configuration Manager Collections UI
    • Click OK, the Service Request Form should appear.
      • Title: Create Collection SR
      • Description: Create CM Collection SR
      • Click the "Activities" Tab
      • Click the Plus sign and select the Runbook Activity Template created earlier
      • Click OK when the form is launched

Create Request Offering for Collection Creation

The Create Collection request offering will be used to configure the user interface displayed via the self-service portal

  • Open the Service Manager Console

  • Go to Library\Service Catalog\Request Offerings and Click "Create Request Offering"

    • Title: Create Collection
    • Description: Create CM Collection
    • Template name: Create Collection SR Template
    • Management Pack: DataCenter Automation: Configuration Manager Collections UI
  • User Prompts

    • Enter Collection Name | Required | Text
    • Select Collection Type | Required | MP Enumeration List
    • Select Location | Required | MP Enumeration List
    • Collection | Display Only | Query Results

clip_image012

  • Configure Prompts

    • Select Collection Type: Type | DataCenter Automation: Service Request Extended
    • Select Location: Office Location | DataCenter Automation: Service Request Extended
    • Collections: Combination Class - Collection Projection
      • Display Columns: DisplayName, CollectionID, MemberCount
      • Options: Add user-select objects to template object as related items: Create Collection SR - (Service Request)
  • Map Prompts to Service Request

    • Location: Select Location
    • CollectionType: Select Collection Type
    • CollectionName: Enter Collection Name
  • Publish: Published

  • Click "Create"

Create Runbook Automation Activity Template for the Delete Collection Runbook

The Runbook Automation Activity Template will be link the Runbook we just created to a Service Request that we will be created later.

  1. Open the Service Manager Console
  2. Go to Library\Templates and click "Create Template"
    • Name: Delete Collection RAA Template

    • Description: Delete CM Collection RAA Template

    • Class: Runbook Automation Activity

    • Management Pack: Click "New"

      • Name: DataCenter Automation: Configuration Manager Collections UI
      • Description: Configuration Manager Collections Templates and Offerings
    • Click OK, the Runbook Activity Form should appear. Check "Is Ready For Automation"

      • Title: Delete Collection RA
      • Description: Delete CM Collection RA
      • Click the "Runbook" Tab
      • Click "Select" and choose the Runbook created earlier
      • Click "Edit Mapping" and choose "Object\Id"
      • Click "OK"

Create Service Request Template for the Create Collection Runbook

The Service Request Template is needed to create a Request Offering using the Runbook Activity Template created previously

  1. Open the Service Manager Console
  2. Go to Library\Templates and click "Create Template"
    • Name: Delete Collection SR Template
    • Description: Delete CM Collection SR Template
    • Class: Service Request
    • Management Pack: DataCenter Automation: Configuration Manager Collections UI
    • Click OK, the Service Request Form should appear.
      • Title: Delete Collection SR
      • Description: Delete CM Collection SR
      • Click the "Activities" Tab
      • Click the Plus sign and select the Runbook Activity Template created earlier
      • Click OK when the form is launched

Create Request Offering for Collection Deletion

The Delete Collection request offering will be used to configure the user interface displayed via the self-service portal

  • Open the Service Manager Console

  • Go to Library\Service Catalog\Request Offerings and Click "Create Request Offering"

    • Title: Delete Collection
    • Description: Delete CM Collection
    • Template name: Delete Collection SR Template
    • Management Pack: DataCenter Automation: Configuration Manager Collections UI
  • User Prompts

    • Collections | Required | Query Results

clip_image013

  • Configure Prompts

    • Collections: Combination Class - Collection Projection
      • Display Columns: DisplayName, CollectionID, MemberCount
      • Options: Add user-select objects to template object as related items: Create Collection SR - (Service Request)
  • Publish: Published

  • Click "Create"

Create Service Offering for Collection Management

The Collection Management service offering will be used to display the Manage Collections requests via the self-service portal

  1. Open the Service Manager Console
  2. Go to Library\Service Catalog\Service Offerings and Click "Create Service Offering"
    • Title: Collection Management
    • Overview: CM Collection Management
    • Description: Manage CM Collections
    • Management Pack: DataCenter Automation: Configuration Manager Collections UI
    • Request Offerings: Create Collection, Delete Collection
    • Publish: Published
    • Click "Create"

Create Collection Groups

This will limit the collections displayed to the collections for the location the logged on user has access to

  1. Open the Service Manager Console

  2. Go to Library\Groups and click "Create Group"

    1. Group name: Dallas Collections

    2. Group description: Collections for devices located in the Dallas location

    3. Management pack: New -> DataCenter Automation: Access Control

    4. Dynamic Members

      1. Class: Collection Projection
      2. Criteria: Display name starts with Dallas%
    5. Click "Create"

  3. Repeat for each location

Create User Roles

User Roles will associate the administrators of each location with a profile within Service Manager

  1. Open the Service Manager Console

  2. Go to Administration\Security\User Roles and click Create User Role\End User

    1. Name: Dallas Administrators
    2. Management Packs: DataCenter Automation: Access Control
    3. Configuration item Groups: Provide access to only selected groups, check each location
    4. Users: Add users you would like to associate with the Dallas location
    5. Click "Create"
  3. Repeat for each location

Test Scenarios

  1. Open the Service Manager Self-Service Portal logged in as a location admin
  2. Click on the Collection Management Service Offering
  3. Click on the Create Collection Request Offering
  4. Click Go to request form
  5. Confirm that only collections at that location are listed
  6. Enter the Collection Name, use Device as type, and choose the location (aka Limiting Collection)
  7. Click Next and then Submit
  8. Repeat testing for Delete Collection
  9. Go to "My Requests" and ensure they were completed successfully
  10. Use CMTrace to view output of the logs

Request Form

clip_image014

CMTrace Log

clip_image015

Summary

This solution allows administrators to create, delete, and view the members of Configuration Manager collections. The Sync Collections runbook also runs when changes are made via the portal which brings changes back into the Server Manager CMDB once the request is complete.

 

Continue to the 7th post in this series: Managing Configuration Manager Collection Membership using the Service Manager Self-Service Portal

Custom.Example.DataCenter.Automation.ServiceRequestExtended.zip