Need to clean out all of the alerts from a development or testing system? Here's a PowerShell script to delete alerts. Run at your own risk... This will delete all alerts in all subsites in all site collections in all web applications (including My Sites).
Did I say… "Run at your own risk"? PowerShell scripts like this one can do real harm on a production system and should only be run on a development or testing system.
So… Run at your own risk…
This should work in both SharePoint 2010 and 2013.
foreach ($site in Get-SPSite -Limit All) { "Site Collection $site" foreach ($web in $site.allwebs) { " Web $web" $c = $web.alerts.count " Deleting $c alerts" for ($i=$c-1;$i -ge 0; $i--) { $web.alerts.delete($i) } } }