Hi @Tom Blokhuis ,
Unfortunately, according to the previous article, in User Alerts, you can only query whether other users have alerts, and if so, you can only delete them, but cannot view or edit them in detail. In other words, you cannot know which library or list this alert is for, and there is no way to determine it.
Therefore, we recommend that you use PowerShell:
#Load SharePoint CSOM Assemblies
Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll"
Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.Runtime.dll"
Function Get-SPOWebAlerts($SiteURL)
{
Try {
#Setup the context
$Ctx = New-Object Microsoft.SharePoint.Client.ClientContext($SiteURL)
$Ctx.Credentials = $Cred
Write-host -f Yellow "Getting Alerts in the site" $SiteURL
#Get All Alerts from the Web
$Web = $Ctx.Web
$WebAlerts = $Web.Alerts
$Ctx.Load($Web)
$Ctx.Load($web.Webs)
$Ctx.Load($WebAlerts)
$Ctx.ExecuteQuery()
If($WebAlerts.count -gt 0) { Write-host -f Green "Found $($WebAlerts.Count) Alerts!"}
$AlertCollection = @()
#Loop through each alert of the web and get alert details
ForEach($Alert in $webAlerts)
{
#Get Alert list and User
$Ctx.Load($Alert.User)
$Ctx.Load($Alert.List)
$Ctx.ExecuteQuery()
$AlertData = New-Object PSObject
$AlertData | Add-Member NoteProperty SiteName($Web.Title)
$AlertData | Add-Member NoteProperty SiteURL($Web.URL)
$AlertData | Add-Member NoteProperty AlertTitle($Alert.Title)
$AlertData | Add-Member NoteProperty AlertUser($Alert.User.Title)
$AlertData | Add-Member NoteProperty AlertList($Alert.List.Title)
$AlertData | Add-Member NoteProperty AlertFrequency($Alert.AlertFrequency)
$AlertData | Add-Member NoteProperty AlertType($Alert.AlertType)
$AlertData | Add-Member NoteProperty AlertEvent($Alert.EventType)
#Add the result to an Array
$AlertCollection += $AlertData
}
#Export Alert Details to CSV file
$AlertCollection | Export-CSV $ReportOutput -NoTypeInformation -Append
#Iterate through each subsite of the current web and call the function recursively
foreach ($Subweb in $web.Webs)
{
#Call the function recursively to process all subsites underneath the current web
Get-SPOWebAlerts($Subweb.url)
}
}
Catch {
write-host -f Red "Error Getting Alerts!" $_.Exception.Message
}
}
#Config Parameters
$SiteURL= "https://crescent.sharepoint.com/"
$ReportOutput="C:\Temp\AlertsRpt.csv"
#Delete the Output Report, if exists
if (Test-Path $ReportOutput) { Remove-Item $ReportOutput }
#Setup Credentials to connect
$Cred = Get-Credential
$Cred = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Cred.UserName,$Cred.Password)
#Call the function
Get-SPOWebAlerts $SiteURL
This PowerShell script gets alerts created in a site collection and generates a CSV file with all alerts in the provided site collection.
Reference:
https://www.sharepointdiary.com/2017/11/sharepoint-online-powershell-to-get-all-alerts-from-site-collection.html
Non-official, just for reference.
Good day!
If the answer is helpful, please click "Accept as Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.