State module for adding and removing scheduled tasks using the Windows Task Scheduler.
Delete a task from the task scheduler.
New in version 3007.0.
True
if successful, otherwise False
CLI Example:
test_win_task_absent:
task.absent:
- name: salt
- location: ""
Create a new task in the designated location. This function has many keyword arguments that are not listed here. For additional arguments see:
New in version 3007.0.
edit_task()
add_action()
add_trigger()
name (str) -- The name of the task. This will be displayed in the task scheduler.
location (str) -- A string value representing the location in which to create the task. Default is "\" which is the root for the task scheduler (C:WindowsSystem32tasks).
user_name (str) -- The user account under which to run the task. To specify the "System" account, use "System". The password will be ignored.
password (str) -- The password to use for authentication. This should set the task to run whether the user is logged in or not, but is currently not working.
force (bool) -- Overwrite the existing task.
A dictionary containing the results of the state
CLI Example:
test_win_task_present:
task.present:
- name: salt
- location: ""
- force: True
- action_type: Execute
- cmd: "del /Q /S C:\\Temp"
- trigger_type: Once
- start_date: 12-1-16
- start_time: 01:00