SharePoint 2010:Powershell Script to Check Which SharePoint List has Event Receivers

SharePoint 2010:Powershell Script to Check Which SharePoint List has Event Receivers

 

PowerShell Script for Event Receivers

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

 

$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(
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 receivers!
Hope this helps you
 

Leave a Comment
  • Please add 5 and 8 and type the answer here:
  • Post
Wiki - Revision Comment List(Revision Comment)
Sort by: Published Date | Most Recent | Most Useful
Comments
  • Lijo  George edited Revision 10. Comment: layout modification

  • Richard Mueller edited Revision 9. Comment: Modified title casing, added tags

  • Fernando Lugão Veltem edited Revision 8. Comment: remove en-us from title

  • Gokhan Ozcifci edited Revision 7. Comment: Design and new title

  • Craig Lussier edited Revision 6. Comment: added en-US to tags and title

  • Rich Prescott edited Revision 3. Comment: Updated script formatting for ease of reading

  • Craig Lussier edited Revision 2. Comment: added article tag - "has code", added garbage collection and pipes to the examples where necessary

  • Ed Price - MSFT edited Revision 1. Comment: Title casing and tags. Great article!

Page 1 of 1 (8 items)
Wikis - Comment List
Sort by: Published Date | Most Recent | Most Useful
Posting comments is temporarily disabled until 10:00am PST on Saturday, December 14th. Thank you for your patience.
Comments
  • Ed Price - MSFT edited Revision 1. Comment: Title casing and tags. Great article!

  • Craig Lussier edited Revision 2. Comment: added article tag - "has code", added garbage collection and pipes to the examples where necessary

  • Rich Prescott edited Revision 3. Comment: Updated script formatting for ease of reading

  • Nice time saving snippet. Thanks for sharing.

  • good article! maybe for the other one's put comment's on your code ! Gokan

  • Craig Lussier edited Revision 6. Comment: added en-US to tags and title

  • Gokhan Ozcifci edited Revision 7. Comment: Design and new title

  • Good article. I use my console application to check all but now i will try with your script

  • Fernando Lugão Veltem edited Revision 8. Comment: remove en-us from title

  • Richard Mueller edited Revision 9. Comment: Modified title casing, added tags

  • Lijo  George edited Revision 10. Comment: layout modification

Page 1 of 1 (11 items)