Click here to Skip to main content
13,091,920 members (59,807 online)
Click here to Skip to main content
Add your own
alternative version


Posted 19 Sep 2011

Sharepoint PowerShell - Delete alerts from list

, 19 Sep 2011
Rate this:
Please Sign up or sign in to vote.
Delete all alerts for a specific list or library on SharePoint.

To delete all alerts assigned in a list or library, we need to specify the web address and the list/library name.

function deleteAlerts(){
    $w = read-host "Web Address"
    $l = read-host "List Name"    
    $web = get-spweb $w
    $list = $web.lists[$l]
    $IDS = ""
    foreach($alert in $web.alerts)
	    if($alert.ListID -eq $list.ID)
		$IDS += $alert.ID.tostring() + "|"
	    write-host -nonewline "*"
    write-host "deleting..."
    foreach($s in $IDS.Split("|"))
	write-host -nonewline "*"

Atention: After you run the script, the object $web could still have the alerts in memory. To be sure that the script runs successfully, open the alerts on SharePoint Web API: Site Actions -> Site settings -> Site Administration -> User Alerts.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Software Developer (Senior) Martifer Inovação e Gestão
Portugal Portugal
No Biography provided

You may also be interested in...

Comments and Discussions

-- There are no messages in this forum --
Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170813.1 | Last Updated 19 Sep 2011
Article Copyright 2011 by brunofer2007
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid