ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Windows Server 2012 - Task Scheduler Issue

    IT Discussion
    8
    54
    3.3k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • anthonyhA
      anthonyh
      last edited by anthonyh

      I am having an interesting problem with the Windows Task Scheduler under Server 2012. I have a couple dozen scheduled tasks that do various things via PowerShell scripts (mostly pull data from a SQL database then ship it off to their respective recipient). These scripts have been in place and scheduled for years. However, recently, about a half dozen of the scheduled tasks have plain stopped triggering and I have no idea why.

      For example, I have a scheduled task that's set to run at 9PM every Monday, Tuesday, Wednesday, Thursday, Friday of every week. It's "Next Run Time" is tonight at 9PM. It's "Last Run Time" was 1/24/2020 at 9:01:20 PM. Whaa?? The "Last Run Result" was "The operation completed successfully. (0x0)".

      I can right click the offending jobs and run them manually no problem. I've "poked" at the scheduled tasks, enabled/disabled them, the trigger, changed the time back/forth, even changed the "Configure for" option from the default "Windows Vista, Windows Server 2008" to "Windows Server 2012". One thing I have not tried exporting/importing the offending tasks.

      I'm curious if any of y'all have experienced anything like this?

      EDIT: I have this script in the example above set to log to a file. The log file has not been touched since Task Scheduler reports the task was run. So I'm pretty confident it's just plain not running these tasks for some reason

      1 1 Reply Last reply Reply Quote 0
      • DashrenderD
        Dashrender
        last edited by

        when was the last reboot?

        anthonyhA 1 Reply Last reply Reply Quote 0
        • 1
          1337 @anthonyh
          last edited by 1337

          @anthonyh said in Windows Server 2012 - Task Scheduler Issue:

          I am having an interesting problem with the Windows Task Scheduler under Server 2012. I have a couple dozen scheduled tasks that do various things via PowerShell scripts (mostly pull data from a SQL database then ship it off to their respective recipient). These scripts have been in place and scheduled for years. However, recently, about a half dozen of the scheduled tasks have plain stopped triggering and I have no idea why.

          For example, I have a scheduled task that's set to run at 9PM every Monday, Tuesday, Wednesday, Thursday, Friday of every week. It's "Next Run Time" is tonight at 9PM. It's "Last Run Time" was 1/24/2020 at 9:01:20 PM. Whaa?? The "Last Run Result" was "The operation completed successfully. (0x0)".

          I can right click the offending jobs and run them manually no problem. I've "poked" at the scheduled tasks, enabled/disabled them, the trigger, changed the time back/forth, even changed the "Configure for" option from the default "Windows Vista, Windows Server 2008" to "Windows Server 2012". One thing I have not tried exporting/importing the offending tasks.

          I'm curious if any of y'all have experienced anything like this?

          If the task doesn't complete, it will not run again. Also the task scheduling service have to be running for any tasks to be triggered.

          Scripts should be made so they produce a log. Then you use the log for troubleshooting.

          anthonyhA 1 Reply Last reply Reply Quote 0
          • anthonyhA
            anthonyh @Dashrender
            last edited by

            @Dashrender said in Windows Server 2012 - Task Scheduler Issue:

            when was the last reboot?

            Last Thursday, believe it or not.

            1 Reply Last reply Reply Quote 0
            • anthonyhA
              anthonyh @1337
              last edited by

              @Pete-S said in Windows Server 2012 - Task Scheduler Issue:

              @anthonyh said in Windows Server 2012 - Task Scheduler Issue:

              I am having an interesting problem with the Windows Task Scheduler under Server 2012. I have a couple dozen scheduled tasks that do various things via PowerShell scripts (mostly pull data from a SQL database then ship it off to their respective recipient). These scripts have been in place and scheduled for years. However, recently, about a half dozen of the scheduled tasks have plain stopped triggering and I have no idea why.

              For example, I have a scheduled task that's set to run at 9PM every Monday, Tuesday, Wednesday, Thursday, Friday of every week. It's "Next Run Time" is tonight at 9PM. It's "Last Run Time" was 1/24/2020 at 9:01:20 PM. Whaa?? The "Last Run Result" was "The operation completed successfully. (0x0)".

              I can right click the offending jobs and run them manually no problem. I've "poked" at the scheduled tasks, enabled/disabled them, the trigger, changed the time back/forth, even changed the "Configure for" option from the default "Windows Vista, Windows Server 2008" to "Windows Server 2012". One thing I have not tried exporting/importing the offending tasks.

              I'm curious if any of y'all have experienced anything like this?

              If the task doesn't complete, it will not run again. Also the task scheduling service have to be running for any tasks to be triggered.

              Right. I have "Stop the task if it runs longer than" set to 3 days. So I should see them in the "Running" state if that were the case, no?

              1 1 Reply Last reply Reply Quote 0
              • 1
                1337 @anthonyh
                last edited by 1337

                @anthonyh said in Windows Server 2012 - Task Scheduler Issue:

                @Pete-S said in Windows Server 2012 - Task Scheduler Issue:

                @anthonyh said in Windows Server 2012 - Task Scheduler Issue:

                I am having an interesting problem with the Windows Task Scheduler under Server 2012. I have a couple dozen scheduled tasks that do various things via PowerShell scripts (mostly pull data from a SQL database then ship it off to their respective recipient). These scripts have been in place and scheduled for years. However, recently, about a half dozen of the scheduled tasks have plain stopped triggering and I have no idea why.

                For example, I have a scheduled task that's set to run at 9PM every Monday, Tuesday, Wednesday, Thursday, Friday of every week. It's "Next Run Time" is tonight at 9PM. It's "Last Run Time" was 1/24/2020 at 9:01:20 PM. Whaa?? The "Last Run Result" was "The operation completed successfully. (0x0)".

                I can right click the offending jobs and run them manually no problem. I've "poked" at the scheduled tasks, enabled/disabled them, the trigger, changed the time back/forth, even changed the "Configure for" option from the default "Windows Vista, Windows Server 2008" to "Windows Server 2012". One thing I have not tried exporting/importing the offending tasks.

                I'm curious if any of y'all have experienced anything like this?

                If the task doesn't complete, it will not run again. Also the task scheduling service have to be running for any tasks to be triggered.

                Right. I have "Stop the task if it runs longer than" set to 3 days. So I should see them in the "Running" state if that were the case, no?

                Depends on if they are running right now. Anyway, how long does the task normally take to complete? Do your scripts produce a log file?

                anthonyhA 1 Reply Last reply Reply Quote 0
                • anthonyhA
                  anthonyh @1337
                  last edited by

                  @Pete-S said in Windows Server 2012 - Task Scheduler Issue:

                  @anthonyh said in Windows Server 2012 - Task Scheduler Issue:

                  @Pete-S said in Windows Server 2012 - Task Scheduler Issue:

                  @anthonyh said in Windows Server 2012 - Task Scheduler Issue:

                  I am having an interesting problem with the Windows Task Scheduler under Server 2012. I have a couple dozen scheduled tasks that do various things via PowerShell scripts (mostly pull data from a SQL database then ship it off to their respective recipient). These scripts have been in place and scheduled for years. However, recently, about a half dozen of the scheduled tasks have plain stopped triggering and I have no idea why.

                  For example, I have a scheduled task that's set to run at 9PM every Monday, Tuesday, Wednesday, Thursday, Friday of every week. It's "Next Run Time" is tonight at 9PM. It's "Last Run Time" was 1/24/2020 at 9:01:20 PM. Whaa?? The "Last Run Result" was "The operation completed successfully. (0x0)".

                  I can right click the offending jobs and run them manually no problem. I've "poked" at the scheduled tasks, enabled/disabled them, the trigger, changed the time back/forth, even changed the "Configure for" option from the default "Windows Vista, Windows Server 2008" to "Windows Server 2012". One thing I have not tried exporting/importing the offending tasks.

                  I'm curious if any of y'all have experienced anything like this?

                  If the task doesn't complete, it will not run again. Also the task scheduling service have to be running for any tasks to be triggered.

                  Right. I have "Stop the task if it runs longer than" set to 3 days. So I should see them in the "Running" state if that were the case, no?

                  Depends on if they are running right now. Anyway, how long does the task take to complete? Do your scripts produce a log file?

                  They are all "Ready" as of this moment. They run nightly, so I should see them as "Running" right now.

                  Some of them do, some of them do not (I've been adding Start/Stop Transcript to them as I've needed to troubleshoot). For those that do log, the log's last modified date/time corresponds to the last time the Task Scheduler reports the task ran.

                  anthonyhA 1 Reply Last reply Reply Quote 0
                  • anthonyhA
                    anthonyh @anthonyh
                    last edited by

                    @anthonyh said in Windows Server 2012 - Task Scheduler Issue:

                    @Pete-S said in Windows Server 2012 - Task Scheduler Issue:

                    @anthonyh said in Windows Server 2012 - Task Scheduler Issue:

                    @Pete-S said in Windows Server 2012 - Task Scheduler Issue:

                    @anthonyh said in Windows Server 2012 - Task Scheduler Issue:

                    I am having an interesting problem with the Windows Task Scheduler under Server 2012. I have a couple dozen scheduled tasks that do various things via PowerShell scripts (mostly pull data from a SQL database then ship it off to their respective recipient). These scripts have been in place and scheduled for years. However, recently, about a half dozen of the scheduled tasks have plain stopped triggering and I have no idea why.

                    For example, I have a scheduled task that's set to run at 9PM every Monday, Tuesday, Wednesday, Thursday, Friday of every week. It's "Next Run Time" is tonight at 9PM. It's "Last Run Time" was 1/24/2020 at 9:01:20 PM. Whaa?? The "Last Run Result" was "The operation completed successfully. (0x0)".

                    I can right click the offending jobs and run them manually no problem. I've "poked" at the scheduled tasks, enabled/disabled them, the trigger, changed the time back/forth, even changed the "Configure for" option from the default "Windows Vista, Windows Server 2008" to "Windows Server 2012". One thing I have not tried exporting/importing the offending tasks.

                    I'm curious if any of y'all have experienced anything like this?

                    If the task doesn't complete, it will not run again. Also the task scheduling service have to be running for any tasks to be triggered.

                    Right. I have "Stop the task if it runs longer than" set to 3 days. So I should see them in the "Running" state if that were the case, no?

                    Depends on if they are running right now. Anyway, how long does the task take to complete? Do your scripts produce a log file?

                    They are all "Ready" as of this moment. They run nightly, so I should see them as "Running" right now.

                    Some of them do, some of them do not (I've been adding Start/Stop Transcript to them as I've needed to troubleshoot). For those that do log, the log's last modified date/time corresponds to the last time the Task Scheduler reports the task ran.

                    I just edited my original post to add that the script I talk about as an example does log, and the log has not been touched since Task Scheduler reported it ran successfully.

                    1 1 Reply Last reply Reply Quote 0
                    • ObsolesceO
                      Obsolesce
                      last edited by

                      What do the event logs say?

                      anthonyhA 1 Reply Last reply Reply Quote 0
                      • anthonyhA
                        anthonyh @Obsolesce
                        last edited by

                        @Obsolesce said in Windows Server 2012 - Task Scheduler Issue:

                        What do the event logs say?

                        Nothing for the offending jobs. I've been scouring the "Operational" event log for Task Scheduler and I see every time the working jobs are fired, and even when jobs are not fired because they're still running (which are expected for some as they run every minute, but sometimes certain maintenance jobs cause them to take a little longer). But the jobs that aren't running...just radio silence. It's as if they're being ignored.

                        1 Reply Last reply Reply Quote 0
                        • 1
                          1337 @anthonyh
                          last edited by

                          @anthonyh said in Windows Server 2012 - Task Scheduler Issue:

                          @anthonyh said in Windows Server 2012 - Task Scheduler Issue:

                          @Pete-S said in Windows Server 2012 - Task Scheduler Issue:

                          @anthonyh said in Windows Server 2012 - Task Scheduler Issue:

                          @Pete-S said in Windows Server 2012 - Task Scheduler Issue:

                          @anthonyh said in Windows Server 2012 - Task Scheduler Issue:

                          I am having an interesting problem with the Windows Task Scheduler under Server 2012. I have a couple dozen scheduled tasks that do various things via PowerShell scripts (mostly pull data from a SQL database then ship it off to their respective recipient). These scripts have been in place and scheduled for years. However, recently, about a half dozen of the scheduled tasks have plain stopped triggering and I have no idea why.

                          For example, I have a scheduled task that's set to run at 9PM every Monday, Tuesday, Wednesday, Thursday, Friday of every week. It's "Next Run Time" is tonight at 9PM. It's "Last Run Time" was 1/24/2020 at 9:01:20 PM. Whaa?? The "Last Run Result" was "The operation completed successfully. (0x0)".

                          I can right click the offending jobs and run them manually no problem. I've "poked" at the scheduled tasks, enabled/disabled them, the trigger, changed the time back/forth, even changed the "Configure for" option from the default "Windows Vista, Windows Server 2008" to "Windows Server 2012". One thing I have not tried exporting/importing the offending tasks.

                          I'm curious if any of y'all have experienced anything like this?

                          If the task doesn't complete, it will not run again. Also the task scheduling service have to be running for any tasks to be triggered.

                          Right. I have "Stop the task if it runs longer than" set to 3 days. So I should see them in the "Running" state if that were the case, no?

                          Depends on if they are running right now. Anyway, how long does the task take to complete? Do your scripts produce a log file?

                          They are all "Ready" as of this moment. They run nightly, so I should see them as "Running" right now.

                          Some of them do, some of them do not (I've been adding Start/Stop Transcript to them as I've needed to troubleshoot). For those that do log, the log's last modified date/time corresponds to the last time the Task Scheduler reports the task ran.

                          I just edited my original post to add that the script I talk about as an example does log, and the log has not been touched since Task Scheduler reported it ran successfully.

                          OK, post screenshot of each tab under that task's properties, including what's under the edit button on the "triggers" tab.

                          ObsolesceO 1 Reply Last reply Reply Quote 0
                          • ObsolesceO
                            Obsolesce @1337
                            last edited by

                            @Pete-S said in Windows Server 2012 - Task Scheduler Issue:

                            @anthonyh said in Windows Server 2012 - Task Scheduler Issue:

                            @anthonyh said in Windows Server 2012 - Task Scheduler Issue:

                            @Pete-S said in Windows Server 2012 - Task Scheduler Issue:

                            @anthonyh said in Windows Server 2012 - Task Scheduler Issue:

                            @Pete-S said in Windows Server 2012 - Task Scheduler Issue:

                            @anthonyh said in Windows Server 2012 - Task Scheduler Issue:

                            I am having an interesting problem with the Windows Task Scheduler under Server 2012. I have a couple dozen scheduled tasks that do various things via PowerShell scripts (mostly pull data from a SQL database then ship it off to their respective recipient). These scripts have been in place and scheduled for years. However, recently, about a half dozen of the scheduled tasks have plain stopped triggering and I have no idea why.

                            For example, I have a scheduled task that's set to run at 9PM every Monday, Tuesday, Wednesday, Thursday, Friday of every week. It's "Next Run Time" is tonight at 9PM. It's "Last Run Time" was 1/24/2020 at 9:01:20 PM. Whaa?? The "Last Run Result" was "The operation completed successfully. (0x0)".

                            I can right click the offending jobs and run them manually no problem. I've "poked" at the scheduled tasks, enabled/disabled them, the trigger, changed the time back/forth, even changed the "Configure for" option from the default "Windows Vista, Windows Server 2008" to "Windows Server 2012". One thing I have not tried exporting/importing the offending tasks.

                            I'm curious if any of y'all have experienced anything like this?

                            If the task doesn't complete, it will not run again. Also the task scheduling service have to be running for any tasks to be triggered.

                            Right. I have "Stop the task if it runs longer than" set to 3 days. So I should see them in the "Running" state if that were the case, no?

                            Depends on if they are running right now. Anyway, how long does the task take to complete? Do your scripts produce a log file?

                            They are all "Ready" as of this moment. They run nightly, so I should see them as "Running" right now.

                            Some of them do, some of them do not (I've been adding Start/Stop Transcript to them as I've needed to troubleshoot). For those that do log, the log's last modified date/time corresponds to the last time the Task Scheduler reports the task ran.

                            I just edited my original post to add that the script I talk about as an example does log, and the log has not been touched since Task Scheduler reported it ran successfully.

                            OK, post screenshot of each tab under that task's properties, including what's under the edit button on the "triggers" tab.

                            Just export the xml here, clean any sensitive info. Easier.

                            anthonyhA 1 2 Replies Last reply Reply Quote 0
                            • anthonyhA
                              anthonyh @Obsolesce
                              last edited by

                              @Obsolesce said in Windows Server 2012 - Task Scheduler Issue:

                              @Pete-S said in Windows Server 2012 - Task Scheduler Issue:

                              @anthonyh said in Windows Server 2012 - Task Scheduler Issue:

                              @anthonyh said in Windows Server 2012 - Task Scheduler Issue:

                              @Pete-S said in Windows Server 2012 - Task Scheduler Issue:

                              @anthonyh said in Windows Server 2012 - Task Scheduler Issue:

                              @Pete-S said in Windows Server 2012 - Task Scheduler Issue:

                              @anthonyh said in Windows Server 2012 - Task Scheduler Issue:

                              I am having an interesting problem with the Windows Task Scheduler under Server 2012. I have a couple dozen scheduled tasks that do various things via PowerShell scripts (mostly pull data from a SQL database then ship it off to their respective recipient). These scripts have been in place and scheduled for years. However, recently, about a half dozen of the scheduled tasks have plain stopped triggering and I have no idea why.

                              For example, I have a scheduled task that's set to run at 9PM every Monday, Tuesday, Wednesday, Thursday, Friday of every week. It's "Next Run Time" is tonight at 9PM. It's "Last Run Time" was 1/24/2020 at 9:01:20 PM. Whaa?? The "Last Run Result" was "The operation completed successfully. (0x0)".

                              I can right click the offending jobs and run them manually no problem. I've "poked" at the scheduled tasks, enabled/disabled them, the trigger, changed the time back/forth, even changed the "Configure for" option from the default "Windows Vista, Windows Server 2008" to "Windows Server 2012". One thing I have not tried exporting/importing the offending tasks.

                              I'm curious if any of y'all have experienced anything like this?

                              If the task doesn't complete, it will not run again. Also the task scheduling service have to be running for any tasks to be triggered.

                              Right. I have "Stop the task if it runs longer than" set to 3 days. So I should see them in the "Running" state if that were the case, no?

                              Depends on if they are running right now. Anyway, how long does the task take to complete? Do your scripts produce a log file?

                              They are all "Ready" as of this moment. They run nightly, so I should see them as "Running" right now.

                              Some of them do, some of them do not (I've been adding Start/Stop Transcript to them as I've needed to troubleshoot). For those that do log, the log's last modified date/time corresponds to the last time the Task Scheduler reports the task ran.

                              I just edited my original post to add that the script I talk about as an example does log, and the log has not been touched since Task Scheduler reported it ran successfully.

                              OK, post screenshot of each tab under that task's properties, including what's under the edit button on the "triggers" tab.

                              Just export the xml here, clean any sensitive info. Easier.

                              Here is the XML of the task I mentioned in my OP. I can do screenshots too if that's still desired by anyone.

                              <?xml version="1.0" encoding="UTF-16"?>
                              <Task version="1.4" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
                                <RegistrationInfo>
                                  <Date>2015-12-23T13:40:10.4492565</Date>
                                  <Author>[REDACTED]</Author>
                                </RegistrationInfo>
                                <Triggers>
                                  <CalendarTrigger>
                                    <StartBoundary>2015-12-23T21:00:00</StartBoundary>
                                    <Enabled>true</Enabled>
                                    <ScheduleByWeek>
                                      <DaysOfWeek>
                                        <Monday />
                                        <Tuesday />
                                        <Wednesday />
                                        <Thursday />
                                        <Friday />
                                      </DaysOfWeek>
                                      <WeeksInterval>1</WeeksInterval>
                                    </ScheduleByWeek>
                                  </CalendarTrigger>
                                </Triggers>
                                <Principals>
                                  <Principal id="Author">
                                    <UserId>S-1-5-18</UserId>
                                    <RunLevel>LeastPrivilege</RunLevel>
                                  </Principal>
                                </Principals>
                                <Settings>
                                  <MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy>
                                  <DisallowStartIfOnBatteries>true</DisallowStartIfOnBatteries>
                                  <StopIfGoingOnBatteries>true</StopIfGoingOnBatteries>
                                  <AllowHardTerminate>true</AllowHardTerminate>
                                  <StartWhenAvailable>false</StartWhenAvailable>
                                  <RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable>
                                  <IdleSettings>
                                    <StopOnIdleEnd>true</StopOnIdleEnd>
                                    <RestartOnIdle>false</RestartOnIdle>
                                  </IdleSettings>
                                  <AllowStartOnDemand>true</AllowStartOnDemand>
                                  <Enabled>true</Enabled>
                                  <Hidden>false</Hidden>
                                  <RunOnlyIfIdle>false</RunOnlyIfIdle>
                                  <DisallowStartOnRemoteAppSession>false</DisallowStartOnRemoteAppSession>
                                  <UseUnifiedSchedulingEngine>false</UseUnifiedSchedulingEngine>
                                  <WakeToRun>false</WakeToRun>
                                  <ExecutionTimeLimit>P3D</ExecutionTimeLimit>
                                  <Priority>7</Priority>
                                </Settings>
                                <Actions Context="Author">
                                  <Exec>
                                    <Command>powershell</Command>
                                    <Arguments>-ExecutionPolicy Bypass -File "C:\scripts[REDACTED].ps1"</Arguments>
                                  </Exec>
                                </Actions>
                              </Task>
                              
                              ObsolesceO 1 Reply Last reply Reply Quote 0
                              • 1
                                1337 @Obsolesce
                                last edited by

                                @Obsolesce said in Windows Server 2012 - Task Scheduler Issue:

                                @Pete-S said in Windows Server 2012 - Task Scheduler Issue:

                                @anthonyh said in Windows Server 2012 - Task Scheduler Issue:

                                @anthonyh said in Windows Server 2012 - Task Scheduler Issue:

                                @Pete-S said in Windows Server 2012 - Task Scheduler Issue:

                                @anthonyh said in Windows Server 2012 - Task Scheduler Issue:

                                @Pete-S said in Windows Server 2012 - Task Scheduler Issue:

                                @anthonyh said in Windows Server 2012 - Task Scheduler Issue:

                                I am having an interesting problem with the Windows Task Scheduler under Server 2012. I have a couple dozen scheduled tasks that do various things via PowerShell scripts (mostly pull data from a SQL database then ship it off to their respective recipient). These scripts have been in place and scheduled for years. However, recently, about a half dozen of the scheduled tasks have plain stopped triggering and I have no idea why.

                                For example, I have a scheduled task that's set to run at 9PM every Monday, Tuesday, Wednesday, Thursday, Friday of every week. It's "Next Run Time" is tonight at 9PM. It's "Last Run Time" was 1/24/2020 at 9:01:20 PM. Whaa?? The "Last Run Result" was "The operation completed successfully. (0x0)".

                                I can right click the offending jobs and run them manually no problem. I've "poked" at the scheduled tasks, enabled/disabled them, the trigger, changed the time back/forth, even changed the "Configure for" option from the default "Windows Vista, Windows Server 2008" to "Windows Server 2012". One thing I have not tried exporting/importing the offending tasks.

                                I'm curious if any of y'all have experienced anything like this?

                                If the task doesn't complete, it will not run again. Also the task scheduling service have to be running for any tasks to be triggered.

                                Right. I have "Stop the task if it runs longer than" set to 3 days. So I should see them in the "Running" state if that were the case, no?

                                Depends on if they are running right now. Anyway, how long does the task take to complete? Do your scripts produce a log file?

                                They are all "Ready" as of this moment. They run nightly, so I should see them as "Running" right now.

                                Some of them do, some of them do not (I've been adding Start/Stop Transcript to them as I've needed to troubleshoot). For those that do log, the log's last modified date/time corresponds to the last time the Task Scheduler reports the task ran.

                                I just edited my original post to add that the script I talk about as an example does log, and the log has not been touched since Task Scheduler reported it ran successfully.

                                OK, post screenshot of each tab under that task's properties, including what's under the edit button on the "triggers" tab.

                                Just export the xml here, clean any sensitive info. Easier.

                                Except that it is not really in clear text. Or do you what user "S-1-5-18" is?

                                anthonyhA ObsolesceO 2 Replies Last reply Reply Quote 0
                                • anthonyhA
                                  anthonyh @1337
                                  last edited by

                                  @Pete-S said in Windows Server 2012 - Task Scheduler Issue:

                                  @Obsolesce said in Windows Server 2012 - Task Scheduler Issue:

                                  @Pete-S said in Windows Server 2012 - Task Scheduler Issue:

                                  @anthonyh said in Windows Server 2012 - Task Scheduler Issue:

                                  @anthonyh said in Windows Server 2012 - Task Scheduler Issue:

                                  @Pete-S said in Windows Server 2012 - Task Scheduler Issue:

                                  @anthonyh said in Windows Server 2012 - Task Scheduler Issue:

                                  @Pete-S said in Windows Server 2012 - Task Scheduler Issue:

                                  @anthonyh said in Windows Server 2012 - Task Scheduler Issue:

                                  I am having an interesting problem with the Windows Task Scheduler under Server 2012. I have a couple dozen scheduled tasks that do various things via PowerShell scripts (mostly pull data from a SQL database then ship it off to their respective recipient). These scripts have been in place and scheduled for years. However, recently, about a half dozen of the scheduled tasks have plain stopped triggering and I have no idea why.

                                  For example, I have a scheduled task that's set to run at 9PM every Monday, Tuesday, Wednesday, Thursday, Friday of every week. It's "Next Run Time" is tonight at 9PM. It's "Last Run Time" was 1/24/2020 at 9:01:20 PM. Whaa?? The "Last Run Result" was "The operation completed successfully. (0x0)".

                                  I can right click the offending jobs and run them manually no problem. I've "poked" at the scheduled tasks, enabled/disabled them, the trigger, changed the time back/forth, even changed the "Configure for" option from the default "Windows Vista, Windows Server 2008" to "Windows Server 2012". One thing I have not tried exporting/importing the offending tasks.

                                  I'm curious if any of y'all have experienced anything like this?

                                  If the task doesn't complete, it will not run again. Also the task scheduling service have to be running for any tasks to be triggered.

                                  Right. I have "Stop the task if it runs longer than" set to 3 days. So I should see them in the "Running" state if that were the case, no?

                                  Depends on if they are running right now. Anyway, how long does the task take to complete? Do your scripts produce a log file?

                                  They are all "Ready" as of this moment. They run nightly, so I should see them as "Running" right now.

                                  Some of them do, some of them do not (I've been adding Start/Stop Transcript to them as I've needed to troubleshoot). For those that do log, the log's last modified date/time corresponds to the last time the Task Scheduler reports the task ran.

                                  I just edited my original post to add that the script I talk about as an example does log, and the log has not been touched since Task Scheduler reported it ran successfully.

                                  OK, post screenshot of each tab under that task's properties, including what's under the edit button on the "triggers" tab.

                                  Just export the xml here, clean any sensitive info. Easier.

                                  Except that it is not really in clear text. Or do you what user "S-1-5-18" is?

                                  FWIW it runs as the SYSTEM account.

                                  1 Reply Last reply Reply Quote 0
                                  • ObsolesceO
                                    Obsolesce @1337
                                    last edited by

                                    @Pete-S said in Windows Server 2012 - Task Scheduler Issue:

                                    @Obsolesce said in Windows Server 2012 - Task Scheduler Issue:

                                    @Pete-S said in Windows Server 2012 - Task Scheduler Issue:

                                    @anthonyh said in Windows Server 2012 - Task Scheduler Issue:

                                    @anthonyh said in Windows Server 2012 - Task Scheduler Issue:

                                    @Pete-S said in Windows Server 2012 - Task Scheduler Issue:

                                    @anthonyh said in Windows Server 2012 - Task Scheduler Issue:

                                    @Pete-S said in Windows Server 2012 - Task Scheduler Issue:

                                    @anthonyh said in Windows Server 2012 - Task Scheduler Issue:

                                    I am having an interesting problem with the Windows Task Scheduler under Server 2012. I have a couple dozen scheduled tasks that do various things via PowerShell scripts (mostly pull data from a SQL database then ship it off to their respective recipient). These scripts have been in place and scheduled for years. However, recently, about a half dozen of the scheduled tasks have plain stopped triggering and I have no idea why.

                                    For example, I have a scheduled task that's set to run at 9PM every Monday, Tuesday, Wednesday, Thursday, Friday of every week. It's "Next Run Time" is tonight at 9PM. It's "Last Run Time" was 1/24/2020 at 9:01:20 PM. Whaa?? The "Last Run Result" was "The operation completed successfully. (0x0)".

                                    I can right click the offending jobs and run them manually no problem. I've "poked" at the scheduled tasks, enabled/disabled them, the trigger, changed the time back/forth, even changed the "Configure for" option from the default "Windows Vista, Windows Server 2008" to "Windows Server 2012". One thing I have not tried exporting/importing the offending tasks.

                                    I'm curious if any of y'all have experienced anything like this?

                                    If the task doesn't complete, it will not run again. Also the task scheduling service have to be running for any tasks to be triggered.

                                    Right. I have "Stop the task if it runs longer than" set to 3 days. So I should see them in the "Running" state if that were the case, no?

                                    Depends on if they are running right now. Anyway, how long does the task take to complete? Do your scripts produce a log file?

                                    They are all "Ready" as of this moment. They run nightly, so I should see them as "Running" right now.

                                    Some of them do, some of them do not (I've been adding Start/Stop Transcript to them as I've needed to troubleshoot). For those that do log, the log's last modified date/time corresponds to the last time the Task Scheduler reports the task ran.

                                    I just edited my original post to add that the script I talk about as an example does log, and the log has not been touched since Task Scheduler reported it ran successfully.

                                    OK, post screenshot of each tab under that task's properties, including what's under the edit button on the "triggers" tab.

                                    Just export the xml here, clean any sensitive info. Easier.

                                    Except that it is not really in clear text. Or do you what user "S-1-5-18" is?

                                    Ya that's a well-known id

                                    1 Reply Last reply Reply Quote 0
                                    • 1
                                      1337
                                      last edited by

                                      What does the task history look like?

                                      anthonyhA 1 Reply Last reply Reply Quote 0
                                      • anthonyhA
                                        anthonyh @1337
                                        last edited by

                                        @Pete-S said in Windows Server 2012 - Task Scheduler Issue:

                                        What does the task history look like?

                                        Looks empty.

                                        5f1e1ec7-9eae-4d2a-9949-1d514987c5fa-image.png

                                        1 Reply Last reply Reply Quote 0
                                        • ObsolesceO
                                          Obsolesce @anthonyh
                                          last edited by

                                          @anthonyh said in Windows Server 2012 - Task Scheduler Issue:

                                          @Obsolesce said in Windows Server 2012 - Task Scheduler Issue:

                                          @Pete-S said in Windows Server 2012 - Task Scheduler Issue:

                                          @anthonyh said in Windows Server 2012 - Task Scheduler Issue:

                                          @anthonyh said in Windows Server 2012 - Task Scheduler Issue:

                                          @Pete-S said in Windows Server 2012 - Task Scheduler Issue:

                                          @anthonyh said in Windows Server 2012 - Task Scheduler Issue:

                                          @Pete-S said in Windows Server 2012 - Task Scheduler Issue:

                                          @anthonyh said in Windows Server 2012 - Task Scheduler Issue:

                                          I am having an interesting problem with the Windows Task Scheduler under Server 2012. I have a couple dozen scheduled tasks that do various things via PowerShell scripts (mostly pull data from a SQL database then ship it off to their respective recipient). These scripts have been in place and scheduled for years. However, recently, about a half dozen of the scheduled tasks have plain stopped triggering and I have no idea why.

                                          For example, I have a scheduled task that's set to run at 9PM every Monday, Tuesday, Wednesday, Thursday, Friday of every week. It's "Next Run Time" is tonight at 9PM. It's "Last Run Time" was 1/24/2020 at 9:01:20 PM. Whaa?? The "Last Run Result" was "The operation completed successfully. (0x0)".

                                          I can right click the offending jobs and run them manually no problem. I've "poked" at the scheduled tasks, enabled/disabled them, the trigger, changed the time back/forth, even changed the "Configure for" option from the default "Windows Vista, Windows Server 2008" to "Windows Server 2012". One thing I have not tried exporting/importing the offending tasks.

                                          I'm curious if any of y'all have experienced anything like this?

                                          If the task doesn't complete, it will not run again. Also the task scheduling service have to be running for any tasks to be triggered.

                                          Right. I have "Stop the task if it runs longer than" set to 3 days. So I should see them in the "Running" state if that were the case, no?

                                          Depends on if they are running right now. Anyway, how long does the task take to complete? Do your scripts produce a log file?

                                          They are all "Ready" as of this moment. They run nightly, so I should see them as "Running" right now.

                                          Some of them do, some of them do not (I've been adding Start/Stop Transcript to them as I've needed to troubleshoot). For those that do log, the log's last modified date/time corresponds to the last time the Task Scheduler reports the task ran.

                                          I just edited my original post to add that the script I talk about as an example does log, and the log has not been touched since Task Scheduler reported it ran successfully.

                                          OK, post screenshot of each tab under that task's properties, including what's under the edit button on the "triggers" tab.

                                          Just export the xml here, clean any sensitive info. Easier.

                                          Here is the XML of the task I mentioned in my OP. I can do screenshots too if that's still desired by anyone.

                                          <?xml version="1.0" encoding="UTF-16"?>
                                          <Task version="1.4" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
                                            <RegistrationInfo>
                                              <Date>2015-12-23T13:40:10.4492565</Date>
                                              <Author>[REDACTED]</Author>
                                            </RegistrationInfo>
                                            <Triggers>
                                              <CalendarTrigger>
                                                <StartBoundary>2015-12-23T21:00:00</StartBoundary>
                                                <Enabled>true</Enabled>
                                                <ScheduleByWeek>
                                                  <DaysOfWeek>
                                                    <Monday />
                                                    <Tuesday />
                                                    <Wednesday />
                                                    <Thursday />
                                                    <Friday />
                                                  </DaysOfWeek>
                                                  <WeeksInterval>1</WeeksInterval>
                                                </ScheduleByWeek>
                                              </CalendarTrigger>
                                            </Triggers>
                                            <Principals>
                                              <Principal id="Author">
                                                <UserId>S-1-5-18</UserId>
                                                <RunLevel>LeastPrivilege</RunLevel>
                                              </Principal>
                                            </Principals>
                                            <Settings>
                                              <MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy>
                                              <DisallowStartIfOnBatteries>true</DisallowStartIfOnBatteries>
                                              <StopIfGoingOnBatteries>true</StopIfGoingOnBatteries>
                                              <AllowHardTerminate>true</AllowHardTerminate>
                                              <StartWhenAvailable>false</StartWhenAvailable>
                                              <RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable>
                                              <IdleSettings>
                                                <StopOnIdleEnd>true</StopOnIdleEnd>
                                                <RestartOnIdle>false</RestartOnIdle>
                                              </IdleSettings>
                                              <AllowStartOnDemand>true</AllowStartOnDemand>
                                              <Enabled>true</Enabled>
                                              <Hidden>false</Hidden>
                                              <RunOnlyIfIdle>false</RunOnlyIfIdle>
                                              <DisallowStartOnRemoteAppSession>false</DisallowStartOnRemoteAppSession>
                                              <UseUnifiedSchedulingEngine>false</UseUnifiedSchedulingEngine>
                                              <WakeToRun>false</WakeToRun>
                                              <ExecutionTimeLimit>P3D</ExecutionTimeLimit>
                                              <Priority>7</Priority>
                                            </Settings>
                                            <Actions Context="Author">
                                              <Exec>
                                                <Command>powershell</Command>
                                                <Arguments>-ExecutionPolicy Bypass -File "C:\scripts[REDACTED].ps1"</Arguments>
                                              </Exec>
                                            </Actions>
                                          </Task>
                                          

                                          Does it run if you right-click on the task and run it manually?

                                          anthonyhA 1 Reply Last reply Reply Quote 0
                                          • anthonyhA
                                            anthonyh @Obsolesce
                                            last edited by

                                            @Obsolesce said in Windows Server 2012 - Task Scheduler Issue:

                                            @anthonyh said in Windows Server 2012 - Task Scheduler Issue:

                                            @Obsolesce said in Windows Server 2012 - Task Scheduler Issue:

                                            @Pete-S said in Windows Server 2012 - Task Scheduler Issue:

                                            @anthonyh said in Windows Server 2012 - Task Scheduler Issue:

                                            @anthonyh said in Windows Server 2012 - Task Scheduler Issue:

                                            @Pete-S said in Windows Server 2012 - Task Scheduler Issue:

                                            @anthonyh said in Windows Server 2012 - Task Scheduler Issue:

                                            @Pete-S said in Windows Server 2012 - Task Scheduler Issue:

                                            @anthonyh said in Windows Server 2012 - Task Scheduler Issue:

                                            I am having an interesting problem with the Windows Task Scheduler under Server 2012. I have a couple dozen scheduled tasks that do various things via PowerShell scripts (mostly pull data from a SQL database then ship it off to their respective recipient). These scripts have been in place and scheduled for years. However, recently, about a half dozen of the scheduled tasks have plain stopped triggering and I have no idea why.

                                            For example, I have a scheduled task that's set to run at 9PM every Monday, Tuesday, Wednesday, Thursday, Friday of every week. It's "Next Run Time" is tonight at 9PM. It's "Last Run Time" was 1/24/2020 at 9:01:20 PM. Whaa?? The "Last Run Result" was "The operation completed successfully. (0x0)".

                                            I can right click the offending jobs and run them manually no problem. I've "poked" at the scheduled tasks, enabled/disabled them, the trigger, changed the time back/forth, even changed the "Configure for" option from the default "Windows Vista, Windows Server 2008" to "Windows Server 2012". One thing I have not tried exporting/importing the offending tasks.

                                            I'm curious if any of y'all have experienced anything like this?

                                            If the task doesn't complete, it will not run again. Also the task scheduling service have to be running for any tasks to be triggered.

                                            Right. I have "Stop the task if it runs longer than" set to 3 days. So I should see them in the "Running" state if that were the case, no?

                                            Depends on if they are running right now. Anyway, how long does the task take to complete? Do your scripts produce a log file?

                                            They are all "Ready" as of this moment. They run nightly, so I should see them as "Running" right now.

                                            Some of them do, some of them do not (I've been adding Start/Stop Transcript to them as I've needed to troubleshoot). For those that do log, the log's last modified date/time corresponds to the last time the Task Scheduler reports the task ran.

                                            I just edited my original post to add that the script I talk about as an example does log, and the log has not been touched since Task Scheduler reported it ran successfully.

                                            OK, post screenshot of each tab under that task's properties, including what's under the edit button on the "triggers" tab.

                                            Just export the xml here, clean any sensitive info. Easier.

                                            Here is the XML of the task I mentioned in my OP. I can do screenshots too if that's still desired by anyone.

                                            <?xml version="1.0" encoding="UTF-16"?>
                                            <Task version="1.4" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
                                              <RegistrationInfo>
                                                <Date>2015-12-23T13:40:10.4492565</Date>
                                                <Author>[REDACTED]</Author>
                                              </RegistrationInfo>
                                              <Triggers>
                                                <CalendarTrigger>
                                                  <StartBoundary>2015-12-23T21:00:00</StartBoundary>
                                                  <Enabled>true</Enabled>
                                                  <ScheduleByWeek>
                                                    <DaysOfWeek>
                                                      <Monday />
                                                      <Tuesday />
                                                      <Wednesday />
                                                      <Thursday />
                                                      <Friday />
                                                    </DaysOfWeek>
                                                    <WeeksInterval>1</WeeksInterval>
                                                  </ScheduleByWeek>
                                                </CalendarTrigger>
                                              </Triggers>
                                              <Principals>
                                                <Principal id="Author">
                                                  <UserId>S-1-5-18</UserId>
                                                  <RunLevel>LeastPrivilege</RunLevel>
                                                </Principal>
                                              </Principals>
                                              <Settings>
                                                <MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy>
                                                <DisallowStartIfOnBatteries>true</DisallowStartIfOnBatteries>
                                                <StopIfGoingOnBatteries>true</StopIfGoingOnBatteries>
                                                <AllowHardTerminate>true</AllowHardTerminate>
                                                <StartWhenAvailable>false</StartWhenAvailable>
                                                <RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable>
                                                <IdleSettings>
                                                  <StopOnIdleEnd>true</StopOnIdleEnd>
                                                  <RestartOnIdle>false</RestartOnIdle>
                                                </IdleSettings>
                                                <AllowStartOnDemand>true</AllowStartOnDemand>
                                                <Enabled>true</Enabled>
                                                <Hidden>false</Hidden>
                                                <RunOnlyIfIdle>false</RunOnlyIfIdle>
                                                <DisallowStartOnRemoteAppSession>false</DisallowStartOnRemoteAppSession>
                                                <UseUnifiedSchedulingEngine>false</UseUnifiedSchedulingEngine>
                                                <WakeToRun>false</WakeToRun>
                                                <ExecutionTimeLimit>P3D</ExecutionTimeLimit>
                                                <Priority>7</Priority>
                                              </Settings>
                                              <Actions Context="Author">
                                                <Exec>
                                                  <Command>powershell</Command>
                                                  <Arguments>-ExecutionPolicy Bypass -File "C:\scripts[REDACTED].ps1"</Arguments>
                                                </Exec>
                                              </Actions>
                                            </Task>
                                            

                                            Does it run if you right-click on the task and run it manually?

                                            As per my OP:

                                            "I can right click the offending jobs and run them manually no problem. "

                                            😄

                                            1 1 Reply Last reply Reply Quote 1
                                            • 1
                                            • 2
                                            • 3
                                            • 1 / 3
                                            • First post
                                              Last post