Remove-PnPEventReceiver

Remove an eventreceiver

Syntax

Remove-PnPEventReceiver
      -Identity <EventReceiverPipeBind>
                             [-List <ListPipeBind>]
                             [-Force [<SwitchParameter>]]
                             [-Web <WebPipeBind>]
                             [-Connection <SPOnlineConnection>]

Description

Removes/unregisters a specific eventreceiver

Examples

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

Remove-PnPEventReceiver -Identity fb689d0e-eb99-4f13-beb3-86692fd39f22

This will remove the event receiver with ReceiverId "fb689d0e-eb99-4f13-beb3-86692fd39f22" from the current web

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

Remove-PnPEventReceiver -List ProjectList -Identity fb689d0e-eb99-4f13-beb3-86692fd39f22

This will remove the event receiver with ReceiverId "fb689d0e-eb99-4f13-beb3-86692fd39f22" from the "ProjectList" list

------------------EXAMPLE 3------------------

Remove-PnPEventReceiver -List ProjectList -Identity MyReceiver

This will remove the event receiver with ReceiverName "MyReceiver" from the "ProjectList" list

------------------EXAMPLE 4------------------

Remove-PnPEventReceiver -List ProjectList

This will remove all event receivers from the "ProjectList" list

------------------EXAMPLE 5------------------

Remove-PnPEventReceiver

This will remove all event receivers from the current site

------------------EXAMPLE 6------------------

Get-PnPEventReceiver | ? ReceiverUrl -Like "*azurewebsites.net*" | Remove-PnPEventReceiver

This will remove all event receivers from the current site which are pointing to a service hosted on Azure Websites

Required Parameters

-Identity

The Guid of the event receiver on the list

Type:EventReceiverPipeBind
Position:Named
Accept pipeline input:True
Accept wildcard characters:False

Optional Parameters

-Connection

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

Type:SPOnlineConnection
Position:Named
Accept pipeline input:False
Accept wildcard characters:False
-Force

Specifying the Force parameter will skip the confirmation question

Type:SwitchParameter
Position:Named
Accept pipeline input:False
Accept wildcard characters:False
-List

The list object from where to remove the event receiver object

Type:ListPipeBind
Position:Named
Accept pipeline input:False
Accept wildcard characters: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
Position:Named
Accept pipeline input:False
Accept wildcard characters:False