Skip to content

xScheduledTask: Trigger has no option for Synchronize across time zones #109

Closed

Description

@StefanSchoof

Details of the scenario you tried and the problem that is occurring:
I have some Scheduled Task set up with xScheduledTask in the Daylight Saving Time on a Windows Server 2016. After End of the DST my Jobs run one hour early. But one hour early the other system was not ready. After removing the "Synchronize across time zones" in the schedule, the start time is the current time (Local Non DST).

I found no option to change the "Synchronize across time zones" this with xScheduledTask.

Activity

  1. PlagueHO commented on Oct 30, 2017

    @PlagueHO
    Member

    Hi @StefanSchoof - are you able to tell me which version of xComputerManagement you're using? There was a fix in v3.0.0.0 that hopefully addressed this.

  2. StefanSchoof commented on Oct 30, 2017

    @StefanSchoof
    Author

    Currently I have 3.0.0.0. I do not remember updating the module since I set up my task, but It is possible I did.

  3. PlagueHO commented on Oct 30, 2017

    @PlagueHO
    Member

    Are you able to take a look at the MOF file that was used to apply to the node to see if it used 3.0.0.0? If it is using 3.0.0.0 and the problem still exists then there may still be an issue with daylight savings time.

  4. StefanSchoof commented on Oct 30, 2017

    @StefanSchoof
    Author

    I search my log and found that the Install-Module run on the 06. October 2017 and the first apply failed because I used the old syntax. I had a RepeatInterval = 1 which I removed. So I think I used 3.0.0.0 the whole time on this Server.

  5. added
    bugThe issue is a bug.
    help wantedThe issue is up for grabs for anyone in the community.
    on Oct 30, 2017
  6. PlagueHO commented on Oct 30, 2017

    @PlagueHO
    Member

    This must still be an issue then. But you are right, it doesn't look like the Synchronize across time zones is exposed in the resource. I couldn't actually find this in the New-ScheduledTaskTrigger cmdlet either - so I'll need to do some more digging to see where/how this gets exposed to PowerShell.

  7. StefanSchoof commented on Oct 30, 2017

    @StefanSchoof
    Author

    Here a the steps for a repo:

    1. Create a Windows 2016 VM in Azure
    2. Deactivate the Hyper-V Time Synchronization Service
    3. Change Time Settings: Settings -> Time & language -> Set time automatically: Off, Time zone UTC + 01:00 Amsterdam, ..., Change Date to 27 October (Had DST Change on 29. October)
    4. Add a dsc file
    configuration ScheduledTask
    {
        param
        (
            [string[]]$NodeName = 'localhost'
        )
    
        Import-DSCResource -ModuleName xComputerManagement
    
        Node $NodeName
        {
            xScheduledTask Test
            {
                TaskName = "Test"
                ActionExecutable = "cmd"
                ScheduleType = "Daily"
                StartTime = "05:00:00 AM"
            }
        }
    }
    
    1. Install-Module xComputerManagement
      . .\dsc.ps1
      ScheduledTask
      Start-DscConfiguration -Path .\ScheduledTask\ -Wait -Verbose

    2. Take a look at the Task Scheduler
      task1
      Next run time is at 5 AM

    3. Change Time Back to 30. October

    4. Take a lock again at the Task Scheduler
      task2
      Next run time is at 4 AM

  8. removed
    help wantedThe issue is up for grabs for anyone in the community.
    on Oct 2, 2018
  9. hassan041 commented on Jan 17, 2020

    @hassan041

    Use Z at the end of time . it enables the option.
    2018-06-14T19:00:00Z

    Z at the end of the time does 2 things.

    1. The time entries would be considered in UTC mode and it automatically converts to Local time in the server when the task is created.
    2. it also enable option "Synchronize across time zones", which will take of any changes like daylight saving of the time zone
  10. PlagueHO commented on Jan 17, 2020

    @PlagueHO
    Member

    Thanks @hassan041 - it is possible we'll be able to improve this code in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThe issue is a bug.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions