Set-SCSPFEventRegistration
设置 Service Management Automation 事件以自动执行 Runbook。
语法
Set-SCSPFEventRegistration
-Resource <String>
-Action <EventRegistrationActionNames>
[-RunbookName <String>]
[-Enabled]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
说明
Set-SCSPFEventRegistration cmdlet 注册 Service Management Automation 事件以自动执行 Runbook。
示例
示例 1:设置事件
PS C:\>Set-SCSPFEventRegistration -ResourceName "VMM.VirtualMachine" -ActionName "Create" -RunbookName "Invoke-SampleCmdlet"
此命令设置一个 Runbook,以便在执行新虚拟机的创建事件时调用。
参数
-Action
指定为其注册业务流程协调程序事件的资源的操作。 此参数的可接受值为:
- Action_Pause
- Action_Publish
- Action_Repair
- Action_Restart
- Action_Resume
- Action_Scale
- Action_Shutdown
- Action_Start
- Action_Stop
- Action_Unpublish
- 创建
- 删除
- 更新
- UpdateStatus
Type: | Microsoft.SystemCenter.Foundation.Cmdlet.EventRegistrationActionNames |
Accepted values: | Create, Update, Delete, Action_Pause, Action_Publish, Action_Repair, Action_Restart, Action_Resume, Action_Scale, Action_Shutdown, Action_Start, Action_Stop, Action_Unpublish, UpdateStatus |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Confirm
提示你在运行 cmdlet 之前进行确认。
Type: | System.Management.Automation.SwitchParameter |
Aliases: | cf |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Enabled
指示事件已启用。
Type: | System.Management.Automation.SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Resource
指定为其注册业务流程协调程序事件的资源。
Type: | System.String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-RunbookName
指定要在执行业务流程协调程序事件时调用的 Runbook。
Type: | System.String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-WhatIf
显示在此 cmdlet 运行的情况下将会发生什么。 此 cmdlet 未运行。
Type: | System.Management.Automation.SwitchParameter |
Aliases: | wi |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
输入
None
输出
System.Object