Search This Blog

Wednesday, August 21, 2013

Powershell Script to Check Which SharePoint List has Event Receivers

You are inheriting a SharePoint site.  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.


$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


For SharePoint 2007 (or 2010)

[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")

$Site = New-Object Microsoft.SharePoint.SPSite
$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 receivers!
Hope this helps you 

No comments:

Post a Comment