Documentation

win_scheduled_task - Manage scheduled tasks

New in version 2.0.

Synopsis

  • Manage scheduled tasks

Options

parameter required default choices comments
arguments
no
Arguments to provide scheduled task action

aliases: argument
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
executable
no
Command the scheduled task should execute

aliases: execute
frequency
no
  • once
  • daily
  • weekly
The frequency of the command, not idempotent
name
yes
Name of the scheduled task
path
no \
Task folder in which this task will be stored
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
    description: open command prompt
    executable: cmd
    arguments: -opt1 -opt2
    path: example
    time: 9am
    frequency: daily
    state: present
    enabled: yes
    user: SYSTEM

Notes

Note

  • This module requires Windows Server 2012 or later.

Status

This module is flagged as preview which means that it is not guaranteed to have a backwards compatible interface.

Support

This module is community maintained without core committer oversight.

For more information on what this means please read Module Support

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