Skip to content

Latest commit

 

History

History
159 lines (119 loc) · 3.9 KB

Add-PnPEventReceiver.md

File metadata and controls

159 lines (119 loc) · 3.9 KB
external help file applicable schema
SharePoint Server 2013, SharePoint Server 2016, SharePoint Online
2.0.0

Add-PnPEventReceiver

SYNOPSIS

Adds a new remote event receiver

SYNTAX

Add-PnPEventReceiver -Name <String>
                     -Url <String>
                     -EventReceiverType <EventReceiverType>
                     -Synchronization <EventReceiverSynchronization>
                     [-List <ListPipeBind>]
                     [-SequenceNumber <Int>]
                     [-Force [<SwitchParameter>]]
                     [-Web <WebPipeBind>]
                     [-Connection <SPOnlineConnection>]

EXAMPLES

------------------EXAMPLE 1------------------

PS:> Add-PnPEventReceiver -List "ProjectList" -Name "TestEventReceiver" -Url https://yourserver.azurewebsites.net/eventreceiver.svc -EventReceiverType ItemAdded -Synchronization Asynchronous

This will add a new remote event receiver that is executed after an item has been added to the ProjectList list

------------------EXAMPLE 2------------------

PS:> Add-PnPEventReceiver -Name "TestEventReceiver" -Url https://yourserver.azurewebsites.net/eventreceiver.svc -EventReceiverType WebAdding -Synchronization Synchronous

This will add a new remote event receiver that is executed while a new subsite is being created

PARAMETERS

-EventReceiverType

The type of the event receiver like ItemAdded, ItemAdding. See https://msdn.microsoft.com/en-us/library/microsoft.sharepoint.client.eventreceivertype.aspx for the full list of available types.

Type: EventReceiverType
Parameter Sets: (All)
Aliases: Type

Required: True
Position: Named
Accept pipeline input: False

-Force

Overwrites the output file if it exists.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-List

The list object or name where the remote event receiver needs to be added. If omitted, the remote event receiver will be added to the web.

Type: ListPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Name

The name of the remote event receiver

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-SequenceNumber

The sequence number where this remote event receiver should be placed

Type: Int
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Synchronization

The synchronization type: Asynchronous or Synchronous

Type: EventReceiverSynchronization
Parameter Sets: (All)
Aliases: Sync

Required: True
Position: Named
Accept pipeline input: False

-Url

The URL of the remote event receiver web service

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by cmdlet. Retrieve the value for this parameter by eiter specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: SPOnlineConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

OUTPUTS

RELATED LINKS

SharePoint Developer Patterns and Practices