C# Corner
Tech
News
Videos
Forums
Trainings
Books
Events
More
Interviews
Jobs
Live
Learn
Career
Members
Blogs
Challenges
Certifications
Bounties
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
Enabling Alerts in SharePoint 2013 - PowerShell Commands
WhatsApp
Lakshmanan Sethu Sankaranarayan
11y
8.4
k
0
0
25
Blog
Lets say you have a SharePoint group named "Notify Members". They would like to receive an alert when a document is added to the document library "Business document". Here are list of PowerShell Commands to achieve the functionality.
$web = Get-SPWeb "
http://localhost/mysite/
"
$group = $web.Groups["Notify Members"]
$list = $web.Lists[" Business document"]
foreach ($user in $group.Users){
$alert = $user.Alerts.Add()
$alert.Title = "Alerts"
$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()
}
$web.Dispose()
People also reading
Membership not found