Share via


SharePoint 2010: Find Event Receivers Attached to Lists

Scenario

You inherit a SharePoint site. Some of the lists do odd things and you want to find out if there are there event receivers on the list. If you have access to PowerShell and the SharePoint servers, you can use the following PowerShell code to find out.

$GC = Start-SPAssignment            
$Site =  $GC | Get-SPSite http://yourserver/sites/yoursite            
$Web = $Site.Rootweb            
$Web.Lists |            
   Where {$_.EventReceivers.Count -gt 0} |            
   Select Title,EventReceivers |            
   Format-List            
Stop-SPAssignment $GC

SharePoint 2007 or 2010

[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")                        
$Site = New-Object Microsoft.SharePoint.SPSite(http://yourserver/sites/yoursite)                        
$Web = $Site.Rootweb                        
$Web.Lists |                        
   Where {$_.EventReceivers.Count -gt 0} |                        
   Select Title,EventReceivers |                        
   Format-List                        
$Web.Dispose()                        
$Site.Dispose()

You could even start at the farm (root) level and drill down to applications, site collections, sites and documents to see each event receiver!

Other Languages

This article is also available in the following languages: