Skip to main content

Posts

Showing posts with the label Powershell

Power Shell Script to get the Event Receivers associated with a SharePoint list

Following Powershell script can be bused to get the Event Receivers associated with a SharePoint list # Define the URL and list name; $webURL = "http://192.168.0.16” $listName = “project initiation note” # Get a reference to the SharePoint web; $web = Get-SPWeb $webURL # Get a reference to the SharePoint list or library; $list = $web.Lists[$listName] # Iterate through and get the event receivers associated foreach($eventReceiverDef in $list.EventReceivers) {     if($eventReceiverDef.Name -ne “”)     {                     $eventInfo = $eventReceiverDef.Name + ” – ” + $eventReceiverDef.Type                     Write-Host $eventInfo -BackgroundColor Green -ForegroundColor Black     } } $web.Dispose()