1

We have email alerts on document library which send email to users after new document has been added. But we want to disable email alerts on this single document library only. How to achieve this?

Thank you.

0

You'd have to delete the existing alerts for all the users and then create a custom permission level that disallows them to create alerts. The permission level will be unique.

Something like (excerpt from here):

Function Disable-ListAlerts($WebURL, $ListName)

{

    #Get the Web and List objects

    $Web = Get-SPWeb $WebURL

    $List = $web.Lists.TryGetList($ListName)



    #Get All Alerts created in the list - Which are Active

    $ListAlerts = $Web.Alerts | Where-Object {($_.List.Title -eq $List.Title) -and ($_.Status -eq "ON")}



    Write-host "Total Number of Active Alerts Found in the list: $($ListAlerts.Count)"



    #Iterate through each alert and turn it OFF

    foreach($Alert in $ListAlerts)

        {

            $Alert.Status="OFF"

            $Alert.Update()

            write-host "Disabled the Alert' $($Alert.Title)' Created for User '$($Alert.User.Name)'"

        }



    #Dispose web object

    $Web.Dispose()

}

Then create a custom permission level that unchecks "Create Alerts", then switch everyone to that new permission level(s).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.