Get-SCSMWorkflow

Retrieves configuration information for Service Manager workflows.

Syntax

Get-SCSMWorkflow [[-DisplayName] <String[]>] [-ComputerName <String[]>] [-Credential <PSCredential>]
 [-SCSession <Connection[]>] [<CommonParameters>]
Get-SCSMWorkflow [-Id] <Guid[]> [-ComputerName <String[]>] [-Credential <PSCredential>]
 [-SCSession <Connection[]>] [<CommonParameters>]
Get-SCSMWorkflow [-Name] <String[]> [-ComputerName <String[]>] [-Credential <PSCredential>]
 [-SCSession <Connection[]>] [<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

This command gets information for the specified workflow, and then stores it in the $Workflow variable.  
PS C:\>$WorkFlow = Get-SCSMWorkflow -DisplayName "Activity Event Workflow Configuration"


This command passes the contents of $Workflow to the Format-List cmdlet. That cmdlet displays the results as a list. 
PS C:\>$WorkFlow | Format-List
DisplayName          : Activity Status Changed Workflow
Description          : Activity Status Changed Workflow
Enabled              : True
Event                : Update
ManagementPack       : [ServiceManager.ActivityManagement.Library, 31bf3856ad364e35, 7.5.1354.0] 
Criteria             : 
                         
                           
                             
                               
                                 
                                   
                                     
                                       $Context/Property[Type='Activity!System.WorkItem.Activity']/Status$
                                     
                                     Equal
                                     
                                       $MPElement[Name="Activity!ActivityStatusEnum.Active"]$
                                     
                                   
                                 
                                 
                                   
                                     
                                       $Context/Property[Type='Activity!System.WorkItem.Activity']/Status$
                                     
                                     Equal
                                     
                                       $MPElement[Name="Activity!ActivityStatusEnum.Completed"]$
                                     
                                   
                                 
                               
                             
                             
                               
                                 
                                   
                                     
                                       $Context/Property[Type='Activity!System.WorkItem.Activity']/Status$
                                     
                                     Equal
                                     
                                       $MPElement[Name="Activity!ActivityStatusEnum.Active"]$
                                     
                                   
                                 
                                 
                                   
                                     
                                       $Context/Property[Type='Activity!System.WorkItem.Activity']/Status$
                                     
                                     Equal
                                     
                                       $MPElement[Name="Activity!ActivityStatusEnum.Skipped"]$
                                     
                                   
                                 
                               
                             
                             
                               
                                 
                                   
                                     
                                       $Context/Property[Type='Activity!System.WorkItem.Activity']/Status$
                                     
                                     Equal
                                     
                                       $MPElement[Name="Activity!ActivityStatusEnum.Rerun"]$
                                     
                                   
                                 
                                 
                                   
                                     
                                       $Context/Property[Type='Activity!System.WorkItem.Activity']/Status$
                                     
                                     Equal
                                     
                                       $MPElement[Name="Activity!ActivityStatusEnum.Skipped"]$
                                     
                                   
                                 
                               
                             
                             
                               
                                 
                                   
                                     
                                       $Context/Property[Type='Activity!System.WorkItem.Activity']/Status$
                                     
                                     Equal
                                     
                                       $MPElement[Name="Activity!ActivityStatusEnum.Active"]$
                                     
                                   
                                 
                                 
                                   
                                     
                                       $Context/Property[Type='Activity!System.WorkItem.Activity']/Status$
                                     
                                     Equal
                                     
                                       $MPElement[Name="Activity!ActivityStatusEnum.Failed"]$
                                     
                                   
                                 
                               
                             
                           
                         
                       
Template             : 
EnableNotification   : False
Notification         : {}
WorkflowSubscription : Microsoft.EnterpriseManagement.Subscriptions.WorkflowSubscription
ManagementPackName   : ServiceManager.ActivityManagement.Library


This command uses standard dot syntax to display the **ManualActivity** property of $Workflow.
PS C:\>$WorkFlow.ManualActivity
DisplayName Description                                                                 Enabled
----------- -----------                                                                 -------
workflow1   Created manual activities will email the reviewers with the assign template false
workflow2   Notify reviewers on updates of a manual activity                            true

This example retrieves the configuration of the Activity Event Workflow Configuration workflow.

Parameters

-ComputerName

Specifies the name of the computer on which the System Center Data Access service runs. The user account that is specified in the Credential parameter must have access rights to the specified computer.

Type:String[]
Required:False
Position:Named
Default value:Localhost
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:PSCredential
Required:False
Position:Named
Default value:None
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:String[]
Required:False
Position:0
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-Id

Specifies the ID of the workflow configuration to retrieve.

Type:Guid[]
Required:True
Position:0
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-Name

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

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

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

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

Inputs

System.String

You can pipe a name to the *DisplayName* parameter.

Inputs

System.Guid

You can pipe a GUID to the *Id* parameter.

Outputs

Microsoft.EnterpriseManagement.ServiceManager.Sdk.Workflows.Workflow

This cmdlet retrieves information about workflows.