Share via


Set-SCSPFEventRegistration

Sets a Service Management Automation event to automate a runbook.

Syntax

Default (Default)

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

Parameter properties

Type:Microsoft.SystemCenter.Foundation.Cmdlet.EventRegistrationActionNames
Default value:None
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
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Confirm

Prompts you for confirmation before running the cmdlet.

Parameter properties

Type:System.Management.Automation.SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:cf

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Enabled

Indicates that the event is enabled.

Parameter properties

Type:System.Management.Automation.SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Resource

Specifies the resource for which the orchestrator event is registered.

Parameter properties

Type:System.String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-RunbookName

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

Parameter properties

Type:System.String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-WhatIf

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

Parameter properties

Type:System.Management.Automation.SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:wi

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

None

Outputs

System.Object