Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 7025

Deprecated: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 2162

Deprecated: Hook imagify_allow_picture_tags_for_webp is deprecated since version 2.2! Use imagify_allow_picture_tags_for_nextgen instead. in /www/collab365_296/public/wp-includes/functions.php on line 5758
Correcting Time Stamps on Alerts after Daylight Savings Time Changes - Collab365
Deprecated: strstr(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 1145

Deprecated: stripos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 1152

Deprecated: stripos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 1155

Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 1162

Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 1165

Deprecated: strstr(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 1145

Deprecated: stripos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 1152

Deprecated: stripos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 1155

Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 1162

Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 1165

Warning: Undefined array key "url" in /www/collab365_296/public/wp-content/plugins/thrive-visual-editor/thrive-dashboard/inc/smart-site/classes/class-tvd-smart-shortcodes.php on line 85

2015-03-10

With the recent time change for Daylight Savings Time, I am reminded that it is time to run some scripts that will update the time stamps for alerts.

Problem: When alerts are set for a list or library, they can be scheduled to be sent immediately or as a daily or weekly summary sent at a specific day and time. When the time changes, the time in the alert is not updated. 

Solution: It is necessary to turn the alert off, then back on again. This resets the internal time for the alert.

Process: First you need to find all of your alerts. The location of your alerts can be verified by using the following PowerShell script, which outputs all of the alerts created on the farm:

$credential = Get-Credential -Credential domain\name

$session = New-PSSession -cn [name] -Credential $credential -Authentication Credssp

function get-allalerts(){

    [void][System.Reflection.Assembly]::LoadWithPartialName(“Microsoft.SharePoint”)

    $farm = [Microsoft.SharePoint.Administration.SPFarm]::Local

    foreach ($spService in $farm.Services) {

        if (!($spService -is [Microsoft.SharePoint.Administration.SPWebService])) {

            continue;

        }

        foreach ($webApp in $spService.WebApplications) {

            #exclude Central Admin app

                                    if ($webApp -is [Microsoft.SharePoint.Administration.SPAdministrationWebApplication]) { continue }

                                    #exclude MySite

                                    if ($webApp -contains “MySite” ) { break }

            foreach ($site in $webApp.Sites) {

                foreach ($web in $site.AllWebs) {

                                                            foreach ($user in $web.SiteUsers)

                                                            {

                                                                        foreach($alert in $user.Alerts)

                                                                        {

                                                                        $lstitemurl = “”

                                                                                    if($alert.AlertType -eq “Item”)

                                                                                    {

                                                                                    $list = $alert.List

                                                                                    $lstitem = $alert.Item

                                                                                    $lstitemtitle = $lstitem.Title

                                                                                    }

                                                                                    $data = @{

                                                                                                            “WebURL” = $web.URL

                                                                                                            “User” = $user.LoginName

                                                                                                            “Alerttitle” = $alert.Title

                                                                                                            “AlertFrequency” = $alert.AlertFrequency

                                                                                                            “AlertType” = $alert.AlertType

                                                                                                            “AlertList” = $list.Title

                                                                                                            “AlertitemTitle” = $lstitemtitle

                                                                                                }

                                                                                                New-Object PSObject -Property $data

                                                                        }

                                                            }                                             

                                                }

                                    }

                        }

            }

}

get-allalerts | Export-Csv -NoTypeInformation -Path “d:\temp\allalerts.csv”

Once the correct location is determined, run the following PowerShell script found here, which turns off the alerts, then turns them back on, which resets the time.

Don’t forget to set a reminder for yourself to do this every time the time changes.

(Visited 276 times, 1 visits today)

About the author 

Darrell Houghton

MCSE and MOS certified in SharePoint 2013. SharePoint power user, evangelist, and teacher. In-depth knowledge of out-of-the-box SharePoint functionality, best practices, business workflows, and site architecture.

Summit Bundle

Get 200+ hours of Microsoft 365 Training for 27$!

Master Office 365, Power Platform & SharePoint & Teams With 200+ Hours Of Training Videos and 108 Ebooks in the Collab365 Academy. This offer is insane and is only available for a limited period.