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.

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

Prompts you for confirmation before running the cmdlet.

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

-Enabled

Indicates that the event is enabled.

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

-Resource

Specifies the resource for which the orchestrator event is registered.

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

-RunbookName

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

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

-WhatIf

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

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

Inputs

None

Outputs

System.Object