Remove Duplicate Registration of Event Receiver- Powershell

# List all the Events registered
$weburl = "http://SharepointWeb"
$spweb = Get-SPWeb $weburl
$spList = $spWeb.Lists["ListName"]
$spList.EventReceivers | Select Name, Assembly, Type

# Remove the Event Registration at index 0
$spList.EventReceivers[0].delete()

Comments

Popular posts from this blog

SharePoint 2016 and 2019 Ports

Clear fields based on drop-down values in PowerApps

Hide a SharePoint list field based on user group using JQuery Webservice in 2010