0

I have a user who is getting alerts from a list (on item create) and he clearly does not want it! I have checked /_layouts/mysubs.aspx and he does not seem to be listed there.

Here are a few things I have tried so far:

  1. Added an alert for him and deleted it subsequently. He still gets the alerts
  2. Asked him to add an alert and delete it which he says he has done but no joy
  3. Written up a console app to list out all alerts in his name in the site collection but none exists

Has anyone come across such oddity?

BTW, he has also confirmed that he never changed his name, email, department to create any anamoly in his identity. He never set up the alert originally and just started appearing in his inbox one fine sunny day!

2
  • Is it "SharePoint Alert" or maybe a workflow based email notification (if you can't see the alert listing)?
    – Paul Leigh
    Nov 27, 2013 at 10:58
  • It is a "Sharepoint Alert" and not email notification from workflow. I have checked workflows to confirm and I have also had a look at the alert and it is the OTB Sharepoint Alert Nov 27, 2013 at 11:20

1 Answer 1

0

Try with the following powershell codes,

Get all Alerts for an user in SharePoint with PowerShell:

Display All alerts for a Particular List

$SPWeb = Get-SPWeb "http://SharePointSite.com" 
#Relative URL of list/document library. For lists "Lists/Tasks" 
$SPListURL = "Shared Documents"  
foreach($alert in $SPWeb.Alerts) 
{ 
    if($alert.ListUrl -eq $SPListUrl) 
    {            
            "User Name    - " + $alert.User.Name 
            "Title        - " + $alert.Title 
            "Frequency    - " + $alert.AlertFrequency 
            "Delivery Via - " + $alert.DeliveryChannels 
            "Change Type  - " + $alert.eventtype 
            Write-Host "=================================="
    } 
} 
$SPweb.Dispose() 

Get Alerts for a Particular User

##### Get alerts for a particular user ######### 
$SPsite = Get-SPSite "http://SharePointSite.com"
$SPweb=$SPsite.RootWeb 
$SPuser=$SPweb.EnsureUser('Domain\Salaudeen') 
$SPalertCollection=$SPuser.Alerts 
foreach($alert in $SPalertCollection) 
{ 
 write-host -f Green $alert.Title 
} 

Find All Alerts of an User in Entire Site collection

$SPsiteCollection = Get-SPSite "http://SharePointSite.com"

    # Iterate through all Webs in the Site Collection 
    foreach($SPweb in $SPsiteCollection.AllWebs)  
     { 
       foreach($alert in $SPweb.Alerts) 
        { 
            Write-Host "Alerts List :" $alert.ListUrl 
        Write-Host "Alerts Title :" $alert.title 
        write-host "Subscribed User: " $alert.user 
         } 
     } 

Find all the Alerts for a specific user across the web:

# ? is the alias for where-object cmdlet
$web.Alerts | ? {$_.UserId -like "Domain\Salaudeen"}

Get all the alerts for a user across the entire site collection:

$site.AllWebs | select -expand Alerts | ? {$_.UserId -like "Domain\Salaudeen"

Delete user alerts in SharePoint 2010 with PowerShell

 ##### Remove all alerts for specific user from a Web Application ##### 



$SPwebApp = Get-SPWebApplication "http://SharePointSite.com"
$SpecificUser = "Domain\Salaudeen"

    foreach ($SPsite in $SPwebApp.Sites) 
    { 
       # get the collection of webs 
       foreach($SPweb in $SPsite.AllWebs)  
        { 
           $alerts = $SPweb.Alerts 

            # if 1 or more alerts for a particular user, Make a note of them by copying their ID to an Array 
            if ($alerts.Count -gt 0) 
            { 
                $myalerts = @() 
                foreach ($alert in $alerts) 
                  { 
                    if ($alert.User -like $SpecificUser) 
                     { 
                        $myalerts += $alert
                     } 
                  } 

               ### now we have alerts for this site, we can delete them 
                foreach ($alertdel in $myalerts) 
                { 
                    $alerts.Delete($alertdel.ID) 
            write-host $alertdel.ID 
                } 
            } 
        } 
    } 

Source

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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