Windows Task scheduler is not working on VM's

Schlaepfer, Lars 0 Reputation points
2023-09-28T07:48:13.3766667+00:00

Hello,

I am using a task scheduler on an Azure virtual machine (VM) to trigger a PowerShell script on a monthly basis. This was working well for a period of time, but now it seems that all tasks (including others, not just the PowerShell script) are no longer functioning. Sometimes, I see in the log that the task is still being executed, but it completes within 2 seconds, and the script is not triggered (which normally takes about 45 minutes). When I manually start the task, it works as expected. I've gone through all possible suggestions on Google and tried them, but nothing seems to help...

Have there been any updates? Should we rebuild the VM (restarting doesn't work either)? What could be the cause of this issue, and what could be a possible solution?

Regards,

Lars

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,907 questions
{count} votes

1 answer

Sort by: Most helpful
  1. vipullag-MSFT 26,311 Reputation points
    2023-10-03T04:52:10.6733333+00:00

    Hello Schlaepfer, Lars

    Welcome to Microsoft Q&A Platform, thanks for posting your query here.

    There could be several reasons why this is happening, such as a misconfiguration of the task, a problem with the PowerShell script, or an issue with the VM itself.

    Before we proceed, I would recommend checking the following:

    Check the task history to see if there are any error messages or warnings that could help identify the issue.

    Verify that the PowerShell script is still working as expected. You can do this by running the script manually and checking for any errors.

    Check the event logs on the VM to see if there are any errors or warnings related to the Task Scheduler.

    Ensure that the VM is up-to-date with the latest Windows updates and patches.

    If none of the above steps help, you may want to try recreating the task from scratch. This can help identify any misconfigurations or issues with the original task.

    If the issue persists, it may be worth considering rebuilding the VM. However, this should be a last resort, as it can be time-consuming and may result in data loss.

    I hope this helps!

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.