Share via


Set-SCSPFExtensibleEventHandler

Sets an extensible event handler in Service Provider Foundation.

Syntax

Default (Default)

Set-SCSPFExtensibleEventHandler
    -EventName <String>
    [-OrchestratorUri <String>]
    [-RunbookPath <String>]
    [-Enable]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

The Set-SCSPFExtensibleEventHandler cmdlet invokes a runbook in System Center - Orchestrator to run whenever a new virtual machine or new service is created. The virtual machine or service must be created by calls to Service Provider Foundation with the Virtual Machine Manager (VMM) service. Service Provider Foundation raises internal events to invoke the runbook, and the runbook will be invoked continuously as long as the extensible event handler is enabled.

Service Provider Foundation will not invoke the runbook if the virtual machine or service was created by other means, such as by using PowerShell cmdlets for by using the console in VMM.

To support the infrastructure for invoking a runbook, Service Provider Foundation calls the Start-SCOrchestratorRunbook cmdlet internally; the user does not need to call it explicitly.

Examples

Example 1: Set an event handler

PS C:\>Set-SCSPFExtensibleEventHandler -EventName "VirtualMachineCreated" -OrchestratorUri "https://scxspf-ws8-24:82/Orchestrator2012/Orchestrator.svc" -RunbookPath "\SPF Runbooks\Extensibility\VM Created" -Enable

This command enables an event handler to invoke a runbook.

Example 2: Disable an event handler

PS C:\>Set-SCSPFExtensibleEventHandler -EventName "VirtualMachineCreated" -OrchestratorUri "https://scxspf-ws8-24:82/Orchestrator2012/Orchestrator.svc" -RunbookPath "\SPF Runbooks\Extensibility\VM Created"

This command disables an event handler from invoking a runbook because the Enable parameter is omitted.

Parameters

-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

-Enable

Indicates that the extensible event handler is enabled. Omit this parameter to disable the handler.

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

-EventName

Specifies either VirtualMachineCreated or ServiceCreated for the event that invokes an Orchestrator runbook.

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

-OrchestratorUri

Specifies the URI of the Orchestrator web service as specified by the web.config file in C:\Program Files (x86)\Microsoft System Center 2012\Orchestrator\Orchestration Console.

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

-RunbookPath

Specifies the path to a runbook in Orchestrator.

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