Get-SCSMWorkflow

检索 Service Manager 工作流的配置信息。

语法

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>]

说明

Get-SCSMWorkflow cmdlet 检索 Service Manager 工作流的配置信息。

示例

示例 1:获取工作流配置

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

此命令检索工作流配置。

示例 2:获取活动事件工作流配置

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

此示例检索“Activity Status Changed”工作流的配置。

示例 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

这些命令显示“Service Request Activity Rerun”工作流的详细信息。

示例 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

此示例检索“解决子事件(已创建父事件)”工作流程的配置详细信息。

示例 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

此示例检索 “ Desired Configuration Management Rule Update” 工作流。

参数

-ComputerName

指定运行 System Center Data Access 服务的计算机的名称。

类型:System.String[]
Position:Named
默认值:Localhost
必需:False
接受管道输入:False
接受通配符:False

-Credential

指定此 cmdlet 用于连接到运行 System Center Data Access 服务的服务器的凭据。 指定的用户帐户必须具有对该服务器的访问权限。

类型:System.Management.Automation.PSCredential
Position:Named
默认值:None
必需:False
接受管道输入:False
接受通配符:False

-DisplayName

指定要检索的工作流配置的显示名称。 您可以指定正则表达式。

类型:System.String[]
Position:0
默认值:None
必需:False
接受管道输入:True
接受通配符:False

-Id

指定要检索的工作流配置的 ID。

类型:System.Guid[]
Position:0
默认值:None
必需:True
接受管道输入:True
接受通配符:False

-Name

指定要检索的工作流程配置的名称。 您可以指定正则表达式。

类型:System.String[]
Position:0
默认值:None
必需:True
接受管道输入:False
接受通配符:False

-SCSession

指定表示与 Service Manager 管理服务器的会话的对象。

类型:Microsoft.SystemCenter.Core.Connection.Connection[]
Position:Named
默认值:None
必需:False
接受管道输入:False
接受通配符:False

输入

System.String

您可以通过管道将名称传递给 DisplayName 参数。

System.Guid

您可以通过管道将 GUID 传递给 Id 参数。

输出

Microsoft.EnterpriseManagement.ServiceManager.Sdk.Workflows.Workflow

此 cmdlet 检索有关工作流的信息。