Set-SCSPFEventRegistration

Sets a Service Management Automation event to automate a runbook.

Syntax

Set-SCSPFEventRegistration
   -Resource <String>
   -Action <EventRegistrationActionNames>
   [-RunbookName <String>]
   [-Enabled]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

The Set-SCSPFEventRegistration cmdlet registers a Service Management Automation event to automate a runbook.

Examples

Example 1: Set an event

PS C:\>Set-SCSPFEventRegistration -ResourceName "VMM.VirtualMachine" -ActionName "Create" -RunbookName "Invoke-SampleCmdlet"

This command sets a runbook to invoke when the create event for a new virtual machine is executed.

Required Parameters

-Action

Specifies the action on a resource for which an orchestrator event is registered. The acceptable values for this parameter are:

  • Action_Pause
  • Action_Publish
  • Action_Repair
  • Action_Restart
  • Action_Resume
  • Action_Scale
  • Action_Shutdown
  • Action_Start
  • Action_Stop
  • Action_Unpublish
  • Create
  • Delete
  • Update
  • UpdateStatus
Type:EventRegistrationActionNames
Parameter Sets: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
Accept pipeline input:False
Accept wildcard characters:False
-Resource

Specifies the resource for which the orchestrator event is registered.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

Optional Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False
-Enabled

Indicates that the event is enabled.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-RunbookName

Specifies the runbook to invoke when the orchestrator event is executed.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False