Short post today on how to quickly grab a list of all the User Alerts in a SharePoint Site Collection.

 

Add-PSSnapin “Microsoft.SharePoint.PowerShell”
$SPSiteCollection = Get-SPSite “http://SiteCollectionName”

foreach($SpWeb in $SPSiteCollection.AllWebs)
{
foreach($alert in $SpWeb.Alerts)
{
Write-host “Alert Frequency :” $alert.AlertFrequency
write-host “User: ” $alert.user
Write-Host “Alert List :” $alert.ListUrl
Write-Host “Alert Title :” $alert.title
Write-Host ” ”
}
}

(4870)

6 thoughts on “Get All User Alerts for SharePoint Site Collection

    1. Hi John,
      I’m certain that there’s better way to get it into the csv, but a quick method would be to just create a new object and Pipe that to a text file.

      $SPSiteCollection = Get-SPSite “SiteCollectionURL”

      $object = foreach($SpWeb in $SPSiteCollection.AllWebs)
      {
      foreach($alert in $SpWeb.Alerts)
      {
      Write-Output “$($alert.AlertFrequency),$($alert.user),$($alert.ListUrl),$($alert.title),”
      }
      }
      $object | Out-file ‘C:\reports\output.txt’ -Append

  1. This is not working, tried against Sharepoint on-prem and the alert property doesn’t exist.
    Used the new module “SharePointPnPPowerShell2016”.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.