Filter by Manual Activity Support Group
Problem:
We implemented the Support Group extension for Manual Activities, however we have unable to identify an efficient means of obtaining the value within Orchestrator. We need to have the ability to filter on the Support Group value to determine if a branch within the Runbook must execute.
Example:
New User setup contains 3 manual activities: 2 assigned to the Help Desk Support Group and 1 assigned to the Server Support Group. If the Support Group = Help Desk, we need the branch/next portion in the runbook to execute.
We identified the Get Object the SupportGroup field is not published to the databus (the value can only be seen from the Runbook Tester). The Get Activity does not retrieve the value at all, neither the databus nor a value seen from within the Runbook Tester.
We had hoped to simply use a line filter include/exclude for X Support Group based on the prior activity, but this is looking a bit bleak.
I can manually pull the value using powershell commands below:
# Import module for Service Manager PowerShell CmdLets
$SMMgmtServer = 'ManagementServer1'
If (!(Get-Module –Name “System.Center.Service.Manager”)) { Import-Module "C:\Program Files\Microsoft System Center 2012 R2\Service Manager\PowerShell\System.Center.Service.Manager.psd1" }
# Creates a connection to the ManagementServer
New-SCManagementGroupConnection -ComputerName $SMMgmtServer
# Connect to Management Server
$EMG = New-Object Microsoft.EnterpriseManagement.EnterpriseManagementGroup $SMMgmtServer
# Retrieve the Work Item, then capture the Support Group value in a Variable
$WorkItem = (get-scsmclass -name "System.WorkItem.Activity.ManualActivity" | get-scsmclassinstance) | where {$_.ID -eq 'MAN1234'}
$SupportGroup = $WorkItem.SupportGroup.DisplayName
However when run in .Net an error is continually returned for the New-SCManamangementGroupConnection.
I also attempted by running the commands above as: powershell.exe { code } , then again the same with adding a PS object within the code section, all to no avail.
Any assistance on this would be greatly appreciated!
Brad
Best Answer
-
Joe_Burrows Cireson Devops Super IT Monkey ✭✭✭✭✭
Answers
Is the Get-Object on the runbook targeting the extended manual activity class? EG:
If you are targeting the extended class you should be able to pull the value fine:
Regards
Joe
Thank you Joe! Worked like a charm!
The difference that I see in what I did was I was using the SC Object Guid instead of ID for Filtering on the Get Object. Regardless, I am excited and thankful to get this working. Appreciate your assistance.