Thursday, December 22, 2011

Convert off Customer Notifies in SharePoint 2010

It would be simple to set up a customer notify in SharePoint 2010 collection however when someone comes again to you and say "Hey its annoying me with the notify emails as am getting 15, 20 emails everyday" you would say "No problems I can fix it" and then you would go again to the collection looking how you can do this and then you realize "What?? I can't do it" and by then you would have included 100 customers to the collection: S




-Yes you need either Control point or Powershell script to turn it off as SharePoint 2010 does not allow you to turn off all the alerts for the users at a time until unless each user logs in and modify it.

I ran into the same situation :D and finally have to get some Powershell script to turn it off.

This would be usefull to you :

++++++++//Script // +++++++++
Start-SPAssignment –Global
$web = Get-SPWeb "***URL of Site***"
$listurl = "***Relative URL of List***"
$IDS = ""
$alertCount = 0

foreach($alert in $web.Alerts)
{
if($alert.ListUrl -eq $ListUrl)
{
$alertCount = $alertCount + 1
Write-Host "Alerts Title :" $alert.title
$IDS += $alert.ID.tostring() + "|"

}
}

Write-Host "Number Of Alerts in List :" $listurl "=" $alertCount

Write-Host "Deleting... "
foreach($s in $IDS.Split("|"))
{
write-host -nonewline "*"
if($s –ne "")
{
$web.alerts.delete([GUID]$s)
}
}

$alertCount = 0

foreach($alert in $web.Alerts)
{
if($alert.ListUrl -eq $ListUrl)
{
$alertCount = $alertCount + 1
Write-Host "Alerts Title :" $alert.title

}
}

Write-Host "Number Of Alerts after REMOVAL in List :" $listurl "=" $alertCount

Stop-SPAssignment –Global


SPONSORS:

No comments:

Post a Comment