Documentation

win_scheduled_task - Manage scheduled tasks

New in version 2.0.

Synopsis

Manage scheduled tasks

Options

parameter required default choices comments
argument
no
    Arguments to provide scheduled task action
    days_of_week
    no
      Days of the week to run a weekly task, not idempotent
      description
      no
        The description for the scheduled task
        enabled
        no True
        • True
        • False
        Enable/disable the task
        execute
        no
          Command the scheduled task should execute
          frequency
          no
          • daily
          • weekly
          The frequency of the command, not idempotent
          name
          yes
            Name of the scheduled task
            path
            no
              Folder path of scheduled task
              state
              yes
              • present
              • absent
              State that the task should become
              time
              no
                Time to execute scheduled task, not idempotent
                user
                no
                  User to run scheduled task as

                  Examples

                  # Create a scheduled task to open a command prompt
                  win_scheduled_task: name="TaskName" execute="cmd" frequency="daily" time="9am" description="open command prompt" path="example" enable=yes state=present user=SYSTEM
                  

                  Notes

                  Note

                  This module requires Windows Server 2012 or later.

                  This is an Extras Module

                  For more information on what this means please read Extras Modules

                  For help in developing on modules, should you be so inclined, please read Community Information & Contributing, Helping Testing PRs and Developing Modules.