Managing Operations Manager Agent Maintenance Mode using the Service Manager Self-Service Portal
This post is the 10th in a series of posts 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 Operations Manager agent maintenance mode.
Series
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 the Start Maintenance Mode Runbook
This Runbook will enable proxy for agents in Operations Manager, trigger the Windows Computer Extended Runbook created previously, and finally update the Description in the Service Request with the result of the Windows Computer Extended 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"
- Link "Get Runbook GUID" 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"
- Click "Finish"
- 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
- 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"}
- Click "Finish"
- Drag the "SC 2012 Service Manager\Get Relationship" activity into the new runbook
- Rename it to "Get Device GUID(s)"
- Link "Get Service Request" to "Get Device GUID(s)"
- Fill out the following properties under "Details"
- Connection: <Your Service Manager Connection>
- Object Class: Service Request
- Object Guid: {SC Object Guid from "Get Service Request"}
- Related Class: Windows Computer
- Click "Finish"
- Drag the "SC 2012 Service Manager\Get Object" activity into the new runbook
- Rename it to "Get Device(s)"
- Link "Get Device GUID(s)" to "Get Device(s)"
- Fill out the following properties under "Details"
- Connection: <Your Service Manager Connection>
- Class: Windows Computer
- Filters: SC Object GUID Equals {Related Object Guid from "Get Device GUID(s)"}
- Click "Finish"
- Drag the "SC 2012 Operations Manager\Get Object" activity into the new runbook
- Rename it to "Start OM Maintenance Mode"
- Link "Get Device(s)" to "Start OM Maintenance Mode"
- Fill out the following properties under "Details"
- Connection: <Your Operations Manager Connection>
- Monitor: {DNS Name from "Get Device(s)"} : Microsoft.Windows.Computer:{DNS Name from "Get Device(s)"}
- Reason: PlannedOther
- Duration: {Description from "Get Service Request"}
- Portal Generated Maintenance Mode from Service Request: {ID from "Get Service Request"}
- Click "Finish"
- Check in the Runbook, it should look similar to this:
Create the Stop Maintenance Mode Runbook
This Runbook will enable proxy for agents in Operations Manager, trigger the Windows Computer Extended Runbook created previously, and finally update the Description in the Service Request with the result of the Windows Computer Extended 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"
- Link "Get Runbook GUID" 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"
- Click "Finish"
- 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
- 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"}
- Click "Finish"
- Drag the "SC 2012 Service Manager\Get Relationship" activity into the new runbook
- Rename it to "Get Device GUID(s)"
- Link "Get Service Request" to "Get Device GUID(s)"
- Fill out the following properties under "Details"
- Connection: <Your Service Manager Connection>
- Object Class: Service Request
- Object Guid: {SC Object Guid from "Get Service Request"}
- Related Class: Windows Computer
- Click "Finish"
- Drag the "SC 2012 Service Manager\Get Object" activity into the new runbook
- Rename it to "Get Device(s)"
- Link "Get Device GUID(s)" to "Get Device(s)"
- Fill out the following properties under "Details"
- Connection: <Your Service Manager Connection>
- Class: Windows Computer
- Filters: SC Object GUID Equals {Related Object Guid from "Get Device GUID(s)"}
- Click "Finish"
- Drag the "SC 2012 Operations Manager\Get Object" activity into the new runbook
- Rename it to "Stop OM Maintenance Mode"
- Link "Get Device(s)" to "Stop OM Maintenance Mode"
- Fill out the following properties under "Details"
- Connection: <Your Operations Manager Connection>
- Monitor: {DNS Name from "Get Device(s)"} : Microsoft.Windows.Computer:{DNS Name from "Get Device(s)"}
- Click "Finish"
- Check in the Runbook, it should look similar to this:
Create the Runbook Automation Activity Template for the Start Maintenance Mode Runbook
The Runbook Automation Activity Template will be link the Runbook we just created to a Service Request that we will be created later.
- Open the Service Manager Console
- Go to Administration\Connectors and Synchronize your Orchestrator Runbook Connector
- Go to Library\Templates and click "Create Template"
- Name: Start Maintenance Mode RAA Template
- Description: Start OM Maintenance Mode RAA Template
- Class: Runbook Automation Activity
- Management Pack: DataCenter Automation: Operations Manager Agents UI
- Click OK, the Runbook Activity Form should appear. Check "Is Ready For Automation"
- Title: Start Maintenance Mode Proxy RA
- Description: Start OM Maintenance Mode RA
- Click the "Runbook" Tab
- Click "Select" and choose the Runbook created earlier
- Click "Edit Mapping" and choose "Object\Id"
- Click "OK"
Create the Service Request Template for the Start Maintenance Mode Runbook
The Service Request Template is needed to create a Request Offering using the Runbook Activity Template created previously
- Open the Service Manager Console
- Go to Library\Templates and click "Create Template"
- Name: Start Maintenance Mode SR Template
- Description: Start OM Maintenance Mode SR Template
- Class: Service Request
- Management Pack: DataCenter Automation: Operations Manager Agents UI
- Click OK, the Service Request Form should appear.
- Title: Start Maintenance Mode SR
- Description: Start OM Maintenance Mode 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 Start Maintenance Mode
The Start Maintenance Mode 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: Start Maintenance Mode
- Description: Start OM Maintenance Mode
- Template name: Start Maintenance Mode SR Template
- Management Pack: DataCenter Automation: Operations Manager Agents UI
- User Prompts
- Duration in Minutes | Required | Integer
- Devices | Required | Query Results
- Configure Prompts
- Select Devices
- Select Class: Windows Computer
- Display Columns: DisplayName, PrincipalName, OMAgent
- Options: Check Allow the user to select multiple objects and Add user-select objects to template object as related items (Enable Agent Proxy SR - (Service Request))
- Publish: Published
- Select Devices
Create the Runbook Automation Activity Template for the Stop Maintenance Mode Runbook
The Runbook Automation Activity Template will be link the Runbook we just created to a Service Request that we will be created later.
- Open the Service Manager Console
- Go to Administration\Connectors and Synchronize your Orchestrator Runbook Connector
- Go to Library\Templates and click "Create Template"
- Name: Stop Maintenance Mode RAA Template
- Description: Stop OM Maintenance Mode RAA Template
- Class: Runbook Automation Activity
- Management Pack: DataCenter Automation: Operations Manager Agents UI
- Click OK, the Runbook Activity Form should appear. Check "Is Ready For Automation"
- Title: Stop Maintenance Mode Proxy RA
- Description: Stop OM Maintenance Mode RA
- Click the "Runbook" Tab
- Click "Select" and choose the Runbook created earlier
- Click "Edit Mapping" and choose "Object\Id"
- Click "OK"
Create the Service Request Template for the Stop Maintenance Mode Runbook
The Service Request Template is needed to create a Request Offering using the Runbook Activity Template created previously
- Open the Service Manager Console
- Go to Library\Templates and click "Create Template"
- Name: Stop Maintenance Mode SR Template
- Description: Stop OM Maintenance Mode SR Template
- Class: Service Request
- Management Pack: DataCenter Automation: Operations Manager Agents UI
- Click OK, the Service Request Form should appear.
- Title: Stop Maintenance Mode SR
- Description: Stop OM Maintenance Mode 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 Stop Maintenance Mode
The Stop Maintenance Mode 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: Stop Maintenance Mode
- Description: Stop OM Maintenance Mode
- Template name: Stop Maintenance Mode SR Template
- Management Pack: DataCenter Automation: Operations Manager Agents UI
- User Prompts
- Devices | Required | Query Results
- Configure Prompts
- Select Devices
- Select Class: Windows Computer
- Display Columns: DisplayName, PrincipalName, OMAgent
- Options: Check Allow the user to select multiple objects and Add user-select objects to template object as related items (Enable Agent Proxy SR - (Service Request))
- Publish: Published
- Select Devices
Add Requests to Existing Service Offering for Agent Management
The Agent Management service offering will be used to display the Operations Manager agent related requests via the self-service portal
- Open the Service Manager Console
- Go to Library\Service Catalog\Service Offerings and open the Agent Management Offering
- Under Request Offering, add the Start and Stop Maintenance Mode offerings
Request Form
Summary
This solution allows administrators to place Operations Manager agents into and out of maintenance mode for a specified time
Continue to the 11th post in this series: Sync Configuration Manager Application Collections in Service Manager
Comments
Anonymous
March 17, 2014
Best set of articles that I have read on making more productive use of System Center products in a long time. A very big THANK YOU. Regards.Anonymous
April 02, 2015
Hey Russ, I am trying to implement this into our environment but it seems that some steps are missing and you may have done this in a previous version of Service Manager - Orchestrator. We are using SCORCH and SCSM 2012 R2 RU5. do you have an adapted version of this walk through?Anonymous
April 02, 2015
Sorry John, I haven't updated this series with the recent updates.Anonymous
April 03, 2015
Hey Russ, Thanks for the reply. I am going to try to figure out how to connect the mappings that are missing for the connection in SM. The other thing we are trying to find is how to schedule this event to a specific time.