Get-SCSMTask

检索在 Service Manager 中定义的任务。

语法

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

说明

Get-SCSMTask cmdlet 检索在Service Manager中定义的任务。

示例

示例 1:获取与事件关联的所有任务

PS C:\>Get-SCSMTask -DisplayName "*incident*"
Enabled Category   Name                                                                description
------- --------   ----                                                                -----------
True    Alert      System.WorkItem.Incident.GeneralSettings.Task                       View or edit the general settings for incident management

True    Alert      System.WorkItem.Incident.ViewAlertDetailsCommand.Task               View alert details
True    Alert      Microsoft.EnterpriseManagement.ServiceManager.UI.Administration.... Create an Incident Resolver user role
True    Alert      System.WorkItem.Incident.ViewHealthStateCommand.Task                View the configuration item's health state
True    Alert      System.WorkItem.Incident.RequestUserInputCommand.Task               Request user input
True    Alert      ServiceManager.IncidentManagement.Library.Task.DesiredConfiguration Configure System Center Configuration Manager Desired Configuration... 
True    Alert      System.WorkItem.Incident.CreateIncidentforConfigItem.Task           Create an incident linked to the current item
True    Alert      System.WorkItem.Incident.ChangeStatusCommand.Task                   Change the incident status
True    Alert      System.WorkItem.Incident.ActivateIncidentCommand.Task               Activate the incident
True    Alert      ConsoleTask.HelpIncident                                            Service Manager Incident Management Help
True    Alert      System.WorkItem.Incident.AssignToMeCommand.Task                     Assign the incident to me
True    Alert      System.WorkItem.Incident.New.Task                                   Create an incident
True    Alert      ServiceManager.IncidentManagement.Library.Task.AutomaticIncident... Configure incident change workflows
True    Alert      System.WorkItem.Incident.EscalateIncidentCommand.Task               Escalate or transfer the incident
True    Alert      System.WorkItem.Incident.AssignCommand.Task                         Assign the incident to an analyst
True    Alert      System.WorkItem.Incident.PingComputerCommand.Task                   Ping related computers
True    Alert      System.WorkItem.Incident.ApplyTemplateCommand.Task                  Apply a template
True    Alert      System.WorkItem.Incident.RemoteComputerCommand.Task                 Remote desktop
True    Alert      System.WorkItem.Incident.CloseIncidentCommand.Task                  Close the incident
True    Alert      System.WorkItem.Incident.ResolveIncidentCommand.Task                Resolve the incident

此命令检索与事件关联的所有任务。

参数

-ComputerName

指定运行 System Center Data Access 服务的计算机的名称。 Credential 参数中指定的用户帐户必须具有对指定计算机的访问权限。

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

-Credential

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

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

-DisplayName

指定要检索的任务对象的显示名称。

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

-Id

指定要检索的任务对象的 ID。

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

-Name

指定要检索的任务对象的名称。

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

-SCSession

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

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

输入

System.String

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

System.Guid

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

输出

Microsoft.EnterpriseManagement.Configuration.ManagementPackConsoleTask

此 cmdlet 返回任务对象。