Delete Orphaned Event Handler through Powershell

This past week my client ran into an issue where a feature removed with FeatureAdmin ( left an orphaned Event Handler on almost every site. Although we were not seeing any performance impacts, the numerous event ID 6644 errors made the Event Viewer hard to look at. So I did some digging and found several references to utilizing PowerShell to remove Event Handlers, but they seemed complex and difficult to modify. So Jeff Jacobs and I began scripting up our own method in the following short but sweet Powershell script:

First off here is the error with the pertinent Assembly information highlighted in red:


 Event Type: Error
Event Source:
Event Category: General
Event ID: 6644
Date:  11/12/2010
Time:  11:16:54 AM
User:  N/A
Event manager error: Could not load file or assembly 'ReplicatorEventHandler, Version, Culture=neutral, PublicTokenKey=ccd0742fa6b8e563' or one of its dependencies. The system cannot find the file specified.
For more information, see Help and Support Center at


If the Assembly is known, in our case it was fully listed in the 6644 errors in the Event Viewer, the deletion can be handled in the following method:

$var = Get-SPSite -limit All | Get-SPWeb -limit all | % {$_.EventReceivers} | where {$_.Assembly -eq "ReplicatorEventHandler, Version, Culture=neutral, PublicTokenKey=ccd0742fa6b8e563"}
$var | % {$_.Delete()}

**Replace the red assembly information with your assembly information


 ** I recommend using the following 2 methods only to identify the event receiver that needs to be deleted and adding it back into the above PS to ensure you are deleting the Event Receiver that is causing issues and not inadvertantly deleting others


If you only know a part of the Assembly name the "-like" statement can be used instead of the "-eq" like this:

$var = Get-SPSite -limit All | Get-SPWeb -limit all | % {$_.EventReceivers} | where {$_.Assembly -like "*Replicator*"} | Select Assembly


 If you do not know any information about the Event Receiver then you can call back all Receivers:

$var = Get-SPSite -limit All | Get-SPWeb -limit all | % {$_.EventReceivers} | where {$_.Assembly -like "*"} | Select Assembly


Skip to main content