0

Is there a way to see who received alerts at the list level? I know you can see/view alerts for other people on a site, but I am interested in being able to see specifically who is receiving alerts for a list on a site. Any guidance is appreciated.

1

Try this code in C# (server object model)

public static string listarAlertasLista(SPWeb web, string listaInternalName)
{
    string alerts = "";
    string listUrl = web.ServerRelativeUrl + "/Lists/" + listaInternalName;
    listUrl = listUrl.Replace("//", "/");

    SPList list = web.GetList(listUrl);
    SPAlertCollection alertsColl = web.Alerts;

    alerts += "<span style='color: blue'>Alertas de la lista " + listaInternalName + "</span><br>";
    foreach (SPAlert alert in alertsColl)
    {
        if (alert.ListID == list.ID)
        {
            alerts += "User: " + alert.User.LoginName + "<br>";
            alerts += "Type: " + alert.AlertType + "<br>";
            alerts += "Chanel: " + alert.DeliveryChannels.ToString() + "<br>";
        }
    }

    return alerts;
}
0

As OOTB there's no solution to get specifically who is receiving alerts for a list on a site.

you can Get all alerts based on specific User from

  • Site Settings > Site Administration > User Alerets > Filter By user.

enter image description here

As a workaround you can use code as @jpussacq mentioned

Or without code from Content Database and filter using ListTitle

SELECT        TOP (1000) UserInfo.tp_Title as UserName,  ImmedSubscriptions.SiteUrl + ImmedSubscriptions.WebUrl AS Site, ImmedSubscriptions.WebTitle, ImmedSubscriptions.ListTitle, 
                         ImmedSubscriptions.ListBaseType, ImmedSubscriptions.AlertTitle, ImmedSubscriptions.AlertType, ImmedSubscriptions.AlwaysNotifyBit, ImmedSubscriptions.SystemBit, ImmedSubscriptions.Status

FROM            ImmedSubscriptions INNER JOIN
                         UserInfo ON ImmedSubscriptions.UserId = UserInfo.tp_ID
WHERE        (ImmedSubscriptions.ListTitle = 'Doc')

OutPut

enter image description here

To show it in SharePoint try to use external List

Note: It's heavily recommended to don't modify anything at Content Database so try to create a view in another database , and create external content type using SharePoint Designer then external list to show it within SharePoint without code.

0

Starting with examples shown at Create - Edit - Find - Delete SharePoint Alerts using PowerShell, I use the following when looking for alerts on a single list.

    ##### Display All alerts for a Particular List within a Site Collection ########

    # Url of the site collection you want to check
    $spSiteUrl = "https://webapp.domain.com/sites/test"

    # Display Name of the web you want to check
    $spWebName = "Web Blah Blah Blah"

    # Display Name of the List/Library you are looking for
    $spListName = "List Blah Blah Blah" 

    # Obtain all alerts in the list/library
    $spAlerts = Get-SPSite -Identity $spSiteUrl `
    | Select-Object -ExpandProperty AllWebs `
    | Where-Object { $_.Title -eq $spWebName } `
    | Select-Object -ExpandProperty Lists `
    | Where-Object { $_.Title -eq $spListName }

    foreach ($spAlert in $spAlerts.ParentWeb.Alerts) {

        $spAlert | Select-Object `
        @{Name="User Display Name";Expression={$_.User.Name}}, `
        @{Name="Title";Expression={$_.Title}}, `
        @{Name="Frequency";Expression={$_.AlertFrequency}}, `
        @{Name="Delivery Methods";Expression={$_.DeliveryChannels}}, `
        @{Name="Change Type";Expression={$_.eventtype}} `
        | Export-Csv -NoTypeInformation -Path "$($env:USERPROFILE)\Documents\ListAlerts.csv" -Append

    }
0
Add-PSSnapin Microsoft.SharePoint.PowerShell –ErrorAction SilentlyContinue

#Variables
$WebURL = "http://YourWebUrl"
$ListName="YourListName"

#Function to Get All Active Alerts on a Given List
Function Get-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")}

  foreach($Alert in $ListAlerts)
  {
          write-host "Alert' - $($Alert.Title)' Created for User - '$($Alert.User.Name)'"
  }

 #Dispose web object
 $Web.Dispose()
}

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.