3

Another user (Charlie) is requesting to have alerts sent anytime a change is made on the "discussion board", "Batch Report" folder, "Reports" folder, and "Audits" folder within a single client site. There are 50 client sites with each of these folders.

My question is, instead of manually setting up alerts on 50 sites x 4 folders = 200 alerts, is there so sort of PowerShell script that can be run to potentially automate this task?

  • sharepointdiary.com/2011/11/… – BlueBird Mar 25 '13 at 19:09
  • @BlueBird, please re-post your response as an answer. also when you re-post please include the answer in full along with the link. Links have a tendency to disappear with time and this keeps the answers relevant. – Jesus Shelby Mar 25 '13 at 19:46
5

Here is a basic outline of creating an alert using powershell. Combine this with some powershell that iterates through the sites / lists you are hoping to target and you have yourself a good start.

$SPsite = Get-SPSite "http://SharePointSite.com"
$SPweb=$SPsite.Rootweb 
$SPlist=$SPweb.lists["Shared documents"] 
$SPuser = $SPweb.EnsureUser('Domain\Salaudeen') 
$SPnewAlert = $SPuser.Alerts.Add() 
$SPnewAlert.Title = "My Custom Alert"
$SPnewAlert.AlertType=[Microsoft.SharePoint.SPAlertType]::List 
$SPnewAlert.List = $SPlist
$SPnewAlert.DeliveryChannels = [Microsoft.SharePoint.SPAlertDeliveryChannels]::Email 
$SPnewAlert.EventType = [Microsoft.SharePoint.SPEventType]::Add 
$SPnewAlert.AlertFrequency = [Microsoft.SharePoint.SPAlertFrequency]::Immediate 
$SPnewAlert.Update() 
$SPweb.Dispose() 
$SPSite.Dispose() 

Read more: http://www.sharepointdiary.com/2011/11/managing-alerts-using-powershell.html#ixzz2OaCHGyYf

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.