community.windows.win_scheduled_task_stat module – Get information about Windows Scheduled Tasks
Note
This module is part of the community.windows collection (version 1.13.0).
You might already have this collection installed if you are using the ansible
package.
It is not included in ansible-core
.
To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install community.windows
.
To use it in a playbook, specify: community.windows.win_scheduled_task_stat
.
Synopsis
Will return whether the folder and task exists.
Returns the names of tasks in the folder specified.
Use community.windows.win_scheduled_task to configure a scheduled task.
Parameters
Parameter |
Comments |
---|---|
The name of the scheduled task to get information for. If |
|
The folder path where the task lives. Default: |
See Also
See also
- community.windows.win_scheduled_task
The official documentation on the community.windows.win_scheduled_task module.
Examples
- name: Get information about a folder
community.windows.win_scheduled_task_stat:
path: \folder name
register: task_folder_stat
- name: Get information about a task in the root folder
community.windows.win_scheduled_task_stat:
name: task name
register: task_stat
- name: Get information about a task in a custom folder
community.windows.win_scheduled_task_stat:
path: \folder name
name: task name
register: task_stat
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
A list of actions. Returned: name is specified and task exists Sample: |
|
Whether the folder set at path exists. Returned: always Sample: |
|
The number of tasks that exist in the folder. Returned: always Sample: |
|
A list of tasks that exist in the folder. Returned: always Sample: |
|
Details on the principal configured to run the task. Returned: name is specified and task exists |
|
The name of the user/group that is displayed in the Task Scheduler UI. Sample: |
|
The group that will run the task. Sample: |
|
The ID for the principal. Sample: |
|
The logon method that the task will run with. Sample: |
|
The level of user rights used to run the task. Sample: |
|
The user that will run the task. Sample: |
|
Details on the task registration info. Returned: name is specified and task exists |
|
The author os the task. Sample: |
|
The date when the task was register. Sample: |
|
The description of the task. Sample: |
|
The documentation of the task. Sample: |
|
The security descriptor of the task. Sample: |
|
The source of the task. Sample: |
|
The URI/path of the task. Sample: |
|
The version of the task. Sample: |
|
Details on the task settings. Returned: name is specified and task exists |
|
Whether the task can be started by using either the Run command of the Context menu. Sample: |
|
Whether the task can terminated by using TerminateProcess. Sample: |
|
The compatibility level of the task Sample: |
|
The amount of time the Task Scheduler will wait before deleting the task after it expires. Sample: |
|
Whether the task will not be started if the computer is running on battery power. Sample: |
|
Whether the task will not be started when in a remote app session. Sample: |
|
Whether the task is enabled. Sample: |
|
The amount of time allowed to complete the task. Sample: |
|
Whether the task is hidden in the UI. Sample: |
|
The idle settings of the task. Sample: |
|
The maintenance settings of the task. |
|
Indicates the behaviour when starting a task that is already running. Sample: |
|
The network settings of the task. Sample: |
|
The priority level of the task. Sample: |
|
The number of times that the task will attempt to restart on failures. Sample: |
|
How long the Task Scheduler will attempt to restart the task. Sample: |
|
Whether the task will run if the computer is in an idle state. Sample: |
|
Whether the task will run only when a network is available. Sample: |
|
Whether the task can start at any time after its scheduled time has passed. Sample: |
|
Whether the task will be stopped if the computer begins to run on battery power. Sample: |
|
Whether the task will use the unified scheduling engine. Sample: |
|
Whether the task is volatile. Sample: |
|
Whether the task will wake the computer when it is time to run the task. Sample: |
|
Details on the state of the task Returned: name is specified and task exists |
|
The time the registered task was last run. Sample: |
|
The results that were returned the last time the task was run. Sample: |
|
The time when the task is next scheduled to run. Sample: |
|
The number of times a task has missed a scheduled run. Sample: |
|
The status of the task, whether it is running, stopped, etc. Sample: |
|
Whether the task at the folder exists. Returned: name is specified Sample: |
|
A list of triggers. Returned: name is specified and task exists Sample: |