Removing Event Receivers Attached to a SharePoint List 2013

To remove any event receivers from the custom list,shoot the following power shell commands.

$spWeb = Get-SPWeb Identity http://mySite
$spList = $spWeb.Lists["Custom List"]
$spList.EventReceivers | Select Name, Assembly, Type
$eventsCount = $spList.EventReceivers.Count
for ($i = $eventsCount-1; $i -ge 0; $i--)
{
$spList.EventReceivers[$i].Delete()
}
$spList.Update()
Ebook Download
View all
Learn
View all