6/08/2011

SharePoint: Which lists have event receivers?

 

You’ve inherited a SharePoint site. Some of the lists do odd things. Are there event receivers on the list?

If you have access to PowerShell and the SharePoint servers, then you can run this little PowerShell script to find out.

 

For SharePoint 2010:

$site = Get-SPSite   http://yourserver/sites/yoursite
$web = $site.Rootweb
$web.Lists | Where {$_.eventreceivers.count -gt 0} | Select title,eventreceivers | Format-List

image

 

For 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

.

You could even start at the farm level and drill down to applications, site collections and sites and document all of the event receivers!

No comments:

Note to spammers!

Spammers, don't waste your time... all posts are moderated. If your comment includes unrelated links, is advertising, or just pure spam, it will never be seen.