Getting all event receiver in a site collection via C# or Powershell | SharePoint 2013
-
07-01-2021 - |
Pregunta
I am trying to get all event receivers in a site collection for all lists and libraries.
Is there any way to do so?
I have got articles where they find it for content types but not for any lists.
Solución
The PowerShell below for your reference:
$site = Get-SPSite "http://sp2013/sites/team"
foreach ($web in $site.AllWebs)
{
$web.Title
$web.Lists | Where {$_.EventReceivers.Count -gt 0} | Select Title,EventReceivers | Format-List
}
Otros consejos
The article SharePoint 2010: Find Event Receivers Attached to Lists describes how this can be done for SP2010 with PowerShell, but it should equally work for 2013.
$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
Licenciado bajo: CC-BY-SA con atribución
No afiliado a sharepoint.stackexchange