Please follow the below steps.
- Start Group Policy Editor (GPE) for the container you want to modify.
- Expand either User Configuration or Computer Configuration.
- Expand Administrative Templates, Windows Components, Task Scheduler.
- Double-click "Prevent Task Run or End."
- Select Enabled and click OK.
refer-
https://www.itprotoday.com/strategy/how-can-i-prevent-user-running-or-stopping-scheduled-process
If the Answer is helpful, please click Accept Answer
and up-vote, so that it can help others in the community looking for help on similar topics.