Copy Alerts from One SharePoint List or Library to Another – Using PowerShell

Requirement: Copy Alerts from one SharePoint list to another list.

Solution: Use this PowerShell script to copy alerts between SharePoint lists or libraries.

My scenario is: We have a list with a number of alerts created for various users. We copied that list to a new site through “Save list as template” and the requirement of copying alerts came!

Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue

function Copy-SPAlerts($SourceWebUrl,$SourceList, $TargetWebUrl, $TargetList)
    #Get the source Web & List objects
    $SourceWeb = Get-SPWeb $SourceWebUrl
    $SourceList= $SourceWeb.lists.TryGetList($SourceList)   

    #Get the Target Web & List objects
    $TargetWeb = Get-SPWeb $TargetWebUrl
    $TargetList= $TargetWeb.lists.TryGetList($TargetList)   
    #Get All Alerts of the Source list
    $SourceAlertsColl = $SourceWeb.Alerts | Where-Object { ($_.List.Title -eq $SourceList.Title)}
    write-host Found $SourceAlertsColl.count alerts in the source List!

    if($SourceAlertsColl.Count -gt 0)
        foreach ($SourceAlert in $SourceAlertsColl)
            #Copy alerts from source to destination
            $alert = $TargetWeb.Alerts.Add()
            $alert.Title = $SourceAlert.Title
            $alert.AlertType = [Microsoft.SharePoint.SPAlertType]::List
            $alert.User = $SourceAlert.user 
            $alert.List = $TargetList
            $alert.DeliveryChannels = $SourceAlert.DeliveryChannels
            $alert.EventType =  $SourceAlert.EventType
            $alert.AlertFrequency = $SourceAlert.AlertFrequency

            Write-Host "Copied Alert: $($SourceAlert.Title)" -foregroundcolor Green


$SourceListName="Project Documents"
$TargetListName="Project Documents"

#Call the function to Copy Alerts
Copy-SPAlerts $SourceWebURL $SourceListName $TargetWebURL $TargetListName

Remember, when you copy alerts from one list to another, it triggers “New Alert Created” E-mail as:

Copy Alerts from One List to Another List in SharePoint

You can disable alerts for time being before copying: How to Disable Alerts in SharePoint List or Library

Salaudeen Rajack

Salaudeen Rajack is a SharePoint Architect with Two decades of SharePoint Experience. He loves sharing his knowledge and experiences with the SharePoint community, through his real-world articles!

3 thoughts on “Copy Alerts from One SharePoint List or Library to Another – Using PowerShell

  • October 19, 2015 at 6:18 PM

    Hi Again –
    Just tested your script for disabling alerts for a specific list. This won’t help with the newly created alerts, right? Seems like it only disabled existing alerts.

    Thanks for any feedback Salaudeen!

  • October 19, 2015 at 6:10 PM

    Wonderful! Million thanks Salaudeen!! I tested your script yesterday and it works perfect!

    I know you already mentioned about the message users will be getting once the new alerts are created. is there anyway to stop that? I thought I could just remove Outgoing SMTP server or set “alerts-enabled to false” and not have those messages sent but realized that won’t even copy the alerts over. Appreciate any feedback you may have on this!

    Again this script is very helpful!


Leave a Reply