salt.states.win_task module

salt.states.win_task.absent(name, location='\\')

Delete a task from the task scheduler.

Parameters
  • name (str) -- The name of the task to delete.

  • location (str) -- A string value representing the location of the task. Default is '\' which is the root for the task scheduler (C:WindowsSystem32tasks).

Return True if successful, False if unsuccessful

Rtype bool

CLI Example:

salt 'minion-id' state.apply <YAML file>
salt.states.win_task.present(name, location='\\', user_name='System', password=None, force=False, **kwargs)

Create a new task in the designated location. This function has many keyword arguments that are not listed here. For additional arguments see:

  • edit_task()

  • add_action()

  • add_trigger()

Parameters
  • 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) -- If the task exists, overwrite the existing task.

Return dict state

Rtype dict

CLI Example:

salt 'minion-id' state.apply <YAML file>