Problems with Scheduled Tasks

Mikhail Firsov 1,876 Reputation points
2022-10-06T10:15:36.747+00:00

Hello!

A couple of days ago I created a GPO that is to add a new scheduled task to my workstations. This GPO consists of the two parameters: the script file (HddAlert.cmd) that must be uploaded to clients and the scheduled task that would run this file in a certain situation.

The result: the HddAlert scheduled task is created on clients, the .cmd file is copied to C:\Scripts folder - so far so good.
248033-01.png

The need arises to change the task (not the file!) as I've mistakenly typed "HddAlert.ps1" instead of

"HddAlert.cmd"- - I modify the task in the GPO and do NOT change the Action type - it's still "Update".

The result: the scheduled task on the client does NOT change.

For testing purposes I change the file in the Files section of the same GPO (Action = Update).

The result: the file is updated on the client (upon reboots, of course).

I then check whether the scheduled task definition is updated in the policy:
248073-04.png

  • as you see the file has been updated and now contains "HddAlert.cmd" instead of "HddAlert.ps1" initially.

The next step: I change the Action to Replace.

The result: no changes.

Just for a test I change the Action to Replace for the file section, reboot and...

The result: HddAlert scheduled task disappears from the client - schtasks /query and powershell can't see it either:
248047-07.png

This happens in the Windows Server 2008R2 domain.

I then repeated all the steps from scratch in my testing Windows Server 2022 domain.

The results:

1) updating the task does NOT work while updating the file does work correctly

2) as soon as I change Action for the task in GPO from Update to Replace the task dissapears from the client's Scheduled Tasks:

248026-08.png

This makes propagating scheduled tasks using GPO completely impossible.

I've seen few forum posts on Internet stating the same problem but all of the seem doesn't have any solution to it.

Maybe I'm doing anything wrong here? Otherwise it`s the bug that exists many-many years....

Thank you in advance,
Michael

Windows Server 2016
Windows Server 2016
A Microsoft server operating system that supports enterprise-level management updated to data storage.
2,389 questions
Windows Server 2012
Windows Server 2012
A Microsoft server operating system that supports enterprise-level management, data storage, applications, and communications.
1,534 questions
Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
12,205 questions
Windows Server Management
Windows Server Management
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.Management: The act or process of organizing, handling, directing or controlling something.
422 questions
Windows Server Infrastructure
Windows Server Infrastructure
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.Infrastructure: A Microsoft solution area focused on providing organizations with a cloud solution that supports their real-world needs and meets evolving regulatory requirements.
516 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Limitless Technology 39,391 Reputation points
    2022-10-07T14:46:13.543+00:00

    Hello there,

    Many users with similar issues have stated that changing the Action to replace has sorted this but it seems you have tried this with no result.

    I would suggest creating a new GPO with a preference to delete the old task first and use another GPO to deploy the task with changed settings. I would also like you to check whether "Run task as soon as possible after a scheduled start a missed" is enabled or not.

    Please have a look into this thread and see if any of the replies help https://learn.microsoft.com/en-us/answers/questions/529154/task-schedule-is-not-working-thru-gpo.html

    ------------------------------------------------------------------------------------------------------------------------------------------------------

    --If the reply is helpful, please Upvote and Accept it as an answer–

    0 comments No comments

  2. Mikhail Firsov 1,876 Reputation points
    2022-10-10T14:12:01.407+00:00

    Hello LimitlessTechnology-2700,

    Thank you for the reply!

    It's weird but I posted my question after creating on friday evening the new GPO with the same scheduled task and making sure it was not working either:

    249081-08-error07102022.png

    Today I was suprised to see the task has appeared and the error is gone:

    249007-09-working10102022.png

    ???

    0 comments No comments