Monday, February 3, 2014

Create Sharepoint Alert for a Group

SharePoint doesn't provide a direct way to create alerts for groups. Alerts are always targeted to individual user accounts in SharePoint. If you have a requirement to create alerts for a group of people, create a E-mail enabled AD security group and add alert to it from SharePoint.

sharepoint create group alert

Set alert to group in SharePoint using PowerShell:
Alternatively, You can use PowerShell to create a SharePoint alert for a group.
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue

#Variables to create group alert
$WebURL="http://intranet.crescent.com/sites/sales/" 
$GroupName="Sales Auditors"
$ListName="Documents"

#Get the objects
$Web = Get-SPWeb $WebURL
$Group = $web.Groups[$GroupName]
$List = $web.Lists[$ListName]

#Loop throgh each user in the group and create new alert
foreach ($user in $group.Users)
{
     #sharepoint set alert to group
     $alert = $user.Alerts.Add()
     $alert.Title = "New Sales Proposal Alert"
     $alert.AlertType = [Microsoft.SharePoint.SPAlertType]::List
     $alert.List = $List
     $alert.DeliveryChannels = [Microsoft.SharePoint.SPAlertDeliveryChannels]::Email
     $alert.EventType = [Microsoft.SharePoint.SPEventType]::Add
     $alert.AlertFrequency = [Microsoft.SharePoint.SPAlertFrequency]::Immediate
     $alert.Update()
}
Write-host "Alerts created for all users in the group:"$GroupName
$web.Dispose()
Related Post: Managing Alerts in SharePoint using PowerShell



You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Check out these SharePoint products:

No comments :

Post a Comment

Please Login and comment to get your questions answered!

You might also like:

Related Posts Plugin for WordPress, Blogger...