共用方式為


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

Description

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

此範例會擷取「活動狀態已變更」工作流程的組態。

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

這些命令會顯示「服務要求活動重新執行」工作流程的詳細數據。

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

此範例會擷取「預期組態管理規則更新」工作流程的組態詳細數據。

參數

-ComputerName

指定 System Center 資料存取服務執行所在的電腦名稱。

類型:System.String[]
Position:Named
預設值:Localhost
必要:False
接受管線輸入:False
接受萬用字元:False

-Credential

指定此 Cmdlet 用來連線到 System Center 資料存取服務執行所在的伺服器認證。 指定的使用者帳戶必須具有該伺服器的訪問許可權。

類型:System.Management.Automation.PSCredential
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-DisplayName

指定要擷取之工作流程組態的顯示名稱。 您可以指定正規表示式。

類型:System.String[]
Position:0
預設值:None
必要:False
接受管線輸入:True
接受萬用字元:False

-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 會擷取工作流程的相關信息。