Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 480
  • Last Modified:

Subscribe "Alert" all users to a particular discussion board list

Dear all.

We currently have an all staff email address in which are looking to replace with discussion boards.

Problem is every user would have to subscribe manually.

Is there a method in PowerShell or similar that I may subscribe all users to a particular list?

Thanks for reading.
0
Michael Arthey
Asked:
Michael Arthey
2 Solutions
 
MontoyaProcess Improvement MgrCommented:
you can subscribe all users that you want, as long as you have rights. When you create an alert, it shows you a box to input email addresses or groups.. but a DL in there and you're set.
0
 
Jayaraja JayaramanCommented:
try the below


get all web users:
function GetSPWebUsers($SiteCollectionURL)
{
    [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint") > $null
    $site = new-object Microsoft.SharePoint.SPSite($SiteCollectionURL)
    $web = $site.openweb()
    $siteUsers = $web.SiteUsers
 
    foreach($user in $siteUsers)
    {        
        Write-Host " ------------------------------------- " 
        Write-Host "Site Collection URL:", $SiteCollectionURL
        if($user.IsSiteAdmin -eq $true)
        {
            Write-Host "ADMIN: ", $user.LoginName
$list=$web.Lists.TryGetList("Shared Documents")
$user = $web.EnsureUser($user.LoginName )
$newAlert = $user.Alerts.Add()
$newAlert.Title = "My Custom Alert"
$newAlert.AlertType=[Microsoft.SharePoint.SPAlertType]::List
$newAlert.List = $list
$newAlert.DeliveryChannels = [Microsoft.SharePoint.SPAlertDeliveryChannels]::Email
$newAlert.EventType = [Microsoft.SharePoint.SPEventType]::Add
$newAlert.AlertFrequency = [Microsoft.SharePoint.SPAlertFrequency]::Immediate
$newAlert.Update()
        }
        else
        {
            Write-Host "USER: ", $user.LoginName
$list=$web.Lists.TryGetList("Shared Documents")
$user = $web.EnsureUser($user.LoginName )
$newAlert = $user.Alerts.Add()
$newAlert.Title = "My Custom Alert"
$newAlert.AlertType=[Microsoft.SharePoint.SPAlertType]::List
$newAlert.List = $list
$newAlert.DeliveryChannels = [Microsoft.SharePoint.SPAlertDeliveryChannels]::Email
$newAlert.EventType = [Microsoft.SharePoint.SPEventType]::Add
$newAlert.AlertFrequency = [Microsoft.SharePoint.SPAlertFrequency]::Immediate
$newAlert.Update()
        }
        Write-Host " ------------------------------------- " 
    }    
    $web.Dispose()
    $site.Dispose()
}
0

Featured Post

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now