Well, hello PowerShell, can you help me? (That's a silly question).
The following is a script I used via SharePoint Management Shell as an Administrator to retrieve a list of alerts for the entire Site collection: http://portalnew
Get Alerts for site collection:
Get-SPweb -site http://portalnew -limit all |
ForEach-Object {$_.alerts|foreach-object{write-host $_.user
$_.properties["siteUrl"] $_.properties["dispformurl"]}}
After performing the above script, I saw a handful of alerts
looking for the old server name. The below script updates the server name for
all alerts needing the update:
Update URL for broken alerts:
Get-SPweb -site http://portalnew -limit all | ForEach-Object
{$_.alerts|foreach-object{$_.properties["siteUrl"] = "http://portalnew";$_.update()}}