Get-SCSMWorkflow

Retrieves configuration information for Service Manager workflows.

Syntax

Get-SCSMWorkflow
   [[-DisplayName] <String[]>]
   [-SCSession <Connection[]>]
   [-ComputerName <String[]>]
   [-Credential <PSCredential>]
   [<CommonParameters>]
Get-SCSMWorkflow
   [-Id] <Guid[]>
   [-SCSession <Connection[]>]
   [-ComputerName <String[]>]
   [-Credential <PSCredential>]
   [<CommonParameters>]
Get-SCSMWorkflow
   [-Name] <String[]>
   [-SCSession <Connection[]>]
   [-ComputerName <String[]>]
   [-Credential <PSCredential>]
   [<CommonParameters>]

Description

The Get-SCSMWorkflow cmdlet retrieves configuration information for Service Manager workflows.

Examples

Example 1: Get workflow configuration

PS C:\>Get-SCSMWorkflow
Enabled DisplayName                                             ManagementPackName
------- -----------                                             ------------------
True    New Service Request Workflow                            ServiceManager.ServiceRequest.Library
True    Service Request Status Changed                          ServiceManager.ServiceRequest.Library
True    Resolve Incident Workflow                               ServiceManager.ProblemManagement.Library
True    Dependent Activity Status                               ServiceManager.ActivityManagement.Library
True    Resolve Child Incidents (Parent Incident resolved)      ServiceManager.IncidentManagement.Library

This command retrieves the workflow configuration.

Example 2: Get the Activity Event Workflow Configuration

PS C:\>Get-SCSMWorkflow "Activity Status Changed"
Enabled DisplayName             ManagementPackName
------- -----------             ------------------
True    Activity Status Changed ServiceManager.ReleaseManagement.Library
True    Activity Status Changed ServiceManager.ChangeManagement.Library
True    Activity Status Changed ServiceManager.ServiceRequest.Library

This example retrieves the configuration of the " Activity Status Changed" workflow.

EXAMPLE 3

PS C:\>$wf = Get-SCSMWorkflow "Service Request Activity Rerun"
DisplayName          : Service Request Activity Rerun
Description          : Service Request Activity Rerun
Enabled              : True
Event                : Update
ManagementPack       : [ServiceManager.ServiceRequest.Library, 9396306c2be7fcc4, 7.5.1088.248] 
Criteria             : <Criteria>
                         <Expression>
                           <And>
                             <Expression>
                               <SimpleExpression>
                                 <ValueExpression>
                                   <Property 
State="Pre">$Context/Property[Type='CoreActivity!System.WorkItem.Activity']/Status$</Property
                                 </ValueExpression>
                                 <Operator>NotEqual</Operator>
                                 <ValueExpression>
                                  
<Value>$MPElement[Name="CoreActivity!ActivityStatusEnum.Rerun"]$</Value>
                                 </ValueExpression>
                               </SimpleExpression>
                             </Expression>
                             <Expression>
                               <SimpleExpression>
                                 <ValueExpression>
                                   <Property 
State="Post">$Context/Property[Type='CoreActivity!System.WorkItem.Activity']/Status$</Property
                                 </ValueExpression>
                                 <Operator>Equal</Operator>
                                 <ValueExpression>

                                   <Value>$MPElement[Name="CoreActivity!ActivityStatusEnum.Rerun"]$</Value>
                                 </ValueExpression>
                               </SimpleExpression>
                             </Expression>
                           </And>
                         </Expression>
                       </Criteria>
Template             : 
EnableNotification   : False
Notification         : {}
WorkflowSubscription : 
Microsoft.EnterpriseManagement.Subscriptions.WorkflowSubscriptionManagementPackName   : 
ServiceManager.ServiceRequest.Library

These commands display the details of the "Service Request Activity Rerun" workflow.

EXAMPLE 4

PS C:\>$wf = Get-SCSMWorkflow "Resolve Child Incidents (Parent Incident created)"
DisplayName          : Resolve Child Incidents (Parent Incident created) 
Description          : Resolve Child Incidents when Parent Incident is created as resolved
Enabled              : True
Event                : Create
ManagementPack       : [ServiceManager.IncidentManagement.Library, 9396306c2be7fcc4, 7.5.1088.248] 
Criteria             : <Criteria>
                         <Expression>
                           <SimpleExpression>
                             <ValueExpression>
                               <Property State="Post">$Context/Property[Type='CoreIncident!System.WorkItem.Incident']/S
                       tatus$</Property>
                             </ValueExpression>
                             <Operator>Equal</Operator>
                             <ValueExpression>
                               <Value>$MPElement[Name="CoreIncident!IncidentStatusEnum.Resolved"]$</Value>
                             </ValueExpression>
                           </SimpleExpression>
                         </Expression>
                       </Criteria>
Template             : 
EnableNotification   : False
Notification         : {}
WorkflowSubscription : Microsoft.EnterpriseManagement.Subscriptions.WorkflowSubscription
ManagementPackName   : ServiceManager.IncidentManagement.Library

This example retrieves the configuration details of the "Resolve Child Incidents (Parent Incident created)" workflow.

EXAMPLE 5

PS C:\>$wf = Get-SCSMWorkflow "Desired Configuration Management Rule Update"
DisplayName          : Desired Configuration Management Rule Update
Description          : Desired Configuration Management Rule Update
Enabled              : True
Event                : Update
ManagementPack       : [ServiceManager.IncidentManagement.Library, 9396306c2be7fcc4, 7.5.1088.248] 
Criteria             : 
Template             : 
EnableNotification   : False
Notification         : {}
WorkflowSubscription : 
Microsoft.EnterpriseManagement.Subscriptions.WorkflowSubscription
ManagementPackName   : ServiceManager.IncidentManagement.Library

This example retrieves the configuration details of the " Desired Configuration Management Rule Update" workflow.

Parameters

-ComputerName

Specifies the name of the computer on which the System Center Data Access service runs.

Type:System.String[]
Position:Named
Default value:Localhost
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Credential

Specifies the credentials that this cmdlet uses to connect to the server on which the System Center Data Access service runs. The specified user account must have access rights to that server.

Type:System.Management.Automation.PSCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DisplayName

Specifies the display name of the workflow configuration to retrieve. You can specify a regular expression.

Type:System.String[]
Position:0
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-Id

Specifies the ID of the workflow configuration to retrieve.

Type:System.Guid[]
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Name

Specifies the name of the workflow configuration to retrieve. You can specify a regular expression.

Type:System.String[]
Position:0
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-SCSession

Specifies the object that represents the session to a Service Manager management server.

Type:Microsoft.SystemCenter.Core.Connection.Connection[]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

System.String

You can pipe a name to the DisplayName parameter.

System.Guid

You can pipe a GUID to the Id parameter.

Outputs

Microsoft.EnterpriseManagement.ServiceManager.Sdk.Workflows.Workflow

This cmdlet retrieves information about workflows.