HEX
Server: Apache
System: Linux server2.voipitup.com.au 4.18.0-553.104.1.lve.el8.x86_64 #1 SMP Tue Feb 10 20:07:30 UTC 2026 x86_64
User: posscale (1027)
PHP: 8.2.29
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/__pycache__/win_task.cpython-310.pyc
o

�N�gh>�@s�dZddlZddlZddlmZddlZddlZddlmZm	Z	zddl
Z
ddlZddlZ
dZWney;dZYnwe�e�ZdZdZdZd	Zd
ZdZdZdZd
ZdZdZdZd	ZdZ dZ!dZ"dZ#dZ$dZ%d
Z&dZ'dZ(dZ)d
Z*dZ+dZ,d	Z-dZ.dZ/dZ0dZ1dZ2d
Z3dZ4dZ5dZ6dZ7d
Z8dZ9dZ:d	Z;d
Z<dZ=dZ>dZ?idd�dd�dd�dd�dd�dd�dd �d!d"�d#d$�d%d&�d'd(�d)d*�d+d,�d-d.�d/d0�d1d2d3g�d4d5d6g�d7d8d9d:d;��Z@eeed<�ZAe5e6e7e8e9e:e;e<e=e>e?d=�ZBe0d>e1d?e2d@e3dAe4dBiZCe#e$e%e&dC�ZDiddD�ddE�ddF�dGdH�dIdJ�dKdL�dMdN�dOdP�dQdR�dSdT�dUdV�dWdX�dYdZ�d[d\�d]d^�d_d`�ZEdadb�ZFdcdd�ZGdedf�ZHdgdh�ZIdidj�ZJdkdl�ZKdmdn�ZLd�dpdq�ZMd�drds�ZNd�dtdu�ZOd�dvdw�ZP	d�dydz�ZQ	d�d{d|�ZRd�d}d~�ZS		o																				
				d�dd��ZTd�d�d��ZUd�d�d��ZVd�d�d��ZWd�d�d��ZXd�d�d��ZYd�d�d��ZZd�d�d��Z[d�d�d��Z\d�d�d��Z]		o												d�d�d��Z^d�d�d��Z_dS)�z�
Windows Task Scheduler Module
.. versionadded:: 2016.3.0

A module for working with the Windows Task Scheduler.
You can add and edit existing tasks.
You can add and clear triggers and actions.
You can list all tasks, folders, triggers, and actions.
�N)�datetime)�ArgumentValueError�CommandExecutionErrorTF�task���������� �	��ImmediatelyZPT0MZIndefinitely�zDo not waitz
15 secondsZPT15Sz
30 secondsZPT30Sz1 minuteZPT1Mz	5 minutesZPT5Mz
10 minutesZPT10Mz
15 minutesZPT15Mz
30 minutesZPT30Mz1 hourZPT1Hz2 hoursZPT2Hz4 hoursZPT4Hz8 hoursZPT8Hz12 hoursZPT12Hz1 dayZP1DZPT24Hz3 daysZP3DZPT72HZP30DZP90DZP180DZP365D)z30 daysz90 daysz180 daysz365 days)�ExecuteZEmail�Message)�EventZOnceZDailyZWeeklyZMonthlyZ
MonthlyDayZOnIdleZOnTaskCreationZOnBootZOnLogonZOnSessionChangeZUnknownZDisabledZQueuedZReadyZRunning)ZParallel�QueuezNo New Instancez
Stop Existingz$The operation completed successfullyz$Incorrect or unknown function calledzFile not found�
zThe environment is incorrectiz/Task is ready to run at its next scheduled timeizTask is currently runningizTask is disabledizTask has not yet runiz.There are no more runs scheduled for this taskizTask was terminated by the user�zCredentials became corruptedlz+An instance of this task is already runningl�z5The operator or administrator has refused the requestl�z7The service is not available (Run only when logged in?)l:z0The application terminated as a result of CTRL+Cl~�zUnknown software exceptioncCs$tjj��rtst�dt�tSdS)z'
    Only works on Windows systems
    z"Could not load dependencies for %s)Fz5Module win_task: module only works on Windows systems)�salt�utils�platformZ
is_windows�HAS_DEPENDENCIES�log�warning�__virtualname__�r!r!�I/opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/win_task.py�__virtual__�s
r#cCs|dkr|d}|S)z?
    Convert negative result and error codes from win32com
    rlr!)�coder!r!r"�_signed_to_unsigned_int32�sr%c	Cs>gd�}|D]}zt�||�|WStyYqwdS)z�
    Copied from win_system.py (_get_date_time_format)

    Function that detects the date/time format for the string passed.

    :param str dt_string:
        A date/time string

    :return: The format of the passed dt_string
    :rtype: str
    )
z%I:%M:%S %pz%I:%M %p�%H:%M:%Sz%H:%M�%Y-%m-%dz%m-%d-%yz%m-%d-%Yz%m/%d/%yz%m/%d/%Yz%Y/%m/%dF)r�strptime�
ValueError)Z	dt_stringZ
valid_formatsZ	dt_formatr!r!r"�_get_date_time_format�s
�r*cCsz|�WStyYdSw)a&
    Function for dealing with PyTime values with invalid dates. ie: 12/30/1899
    which is the windows task scheduler value for Never

    :param obj date: A PyTime object

    :return: A string value representing the date or the word "Never" for
    invalid date strings
    :rtype: str
    ZNever)r))�dater!r!r"�_get_date_value�s
�r,cCs^d}t|���D]\}}t|t�r||vr|}n
q||kr"|}nq|dkr)dSt|�|S)a
    Lookup the key in a dictionary by its value. Will return the first match.

    :param dict dictionary: The dictionary to search

    :param str value: The value to search for.

    :return: Returns the first key to match the value
    :rtype: str
    ���rz
invalid value)�	enumerate�values�
isinstance�list)�
dictionary�valueZvalue_index�idxZ
dict_valuer!r!r"�_reverse_lookup�s
��r5cCs||}t|t�r
|dS|S)a 
    Lookup the first value given a key. Returns the first value if the key
    refers to a list or the value itself.

    :param dict dictionary: The dictionary to search

    :param str key: The key to get

    :return: Returns the first value available for the key
    :rtype: str
    r)r0r1)r2�keyr3r!r!r"�
_lookup_firsts
r7cCs�z
|�||t|||�WdStjyW}z=|j\}}}	}
t|	d�}dddddd�}z||}
WntyAd	t|���}
Ynwt�	d
|
�d|
��WYd}~Sd}~ww)
a
    Internal function to save the task definition.

    :param str name: The name of the task.

    :param str task_folder: The object representing the folder in which to save
    the task

    :param str task_definition: The object representing the task to be saved

    :param str user_name: The user_account under which to run the task

    :param str password: The password that corresponds to the user account

    :param int logon_type: The logon type for the task.

    :return: True if successful, False if not
    :rtype: bool
    TrzAThe filename, directory name, or volume label syntax is incorrectz)The system cannot find the file specified�%Required element or attribute missing�+Value incorrectly formatted or out of range�
Access denied)l{l����Unknown Failure: zFailed to modify task: %szFailed to modify task: N)
ZRegisterTaskDefinition�TASK_CREATE_OR_UPDATE�	pythoncom�	com_error�argsr%�KeyError�hexr�debug)�name�task_folder�task_definition�	user_name�password�
logon_type�error�hr�msg�exc�arg�
error_code�fc�failure_coder!r!r"�_save_task_definition!s8�	�	���rT�\c	Cs�tjj���Ctj�d�}|��z|�|�}Wnt	j
y.d|��}t�|�t
|��w|�d�}g}|D]}|�|j�q8Wd�|S1sLwY|S)av
    List all tasks located in a specific location in the task scheduler.

    Args:

        location (str):
            A string value representing the folder from which you want to list
            tasks. Default is ``\`` which is the root for the task scheduler
            (``C:\Windows\System32\tasks``).

    Returns:
        list: Returns a list of tasks

    CLI Example:

    .. code-block:: bash

        # List all tasks in the default location
        salt 'minion-id' task.list_tasks

        # List all tasks in the Microsoft\XblGameSave Directory
        salt 'minion-id' task.list_tasks Microsoft\XblGameSave
    �Schedule.ServicezUnable to load location: rN)rr�winapi�Com�win32com�client�Dispatch�Connect�	GetFolder�
pywintypesrArrLrZGetTasks�append�Name)�location�task_servicerGrNZtasks�retrr!r!r"�
list_tasksYs&

�
�
��rdcCsttjj���*tj�d�}|��|�|�}|�	d�}g}|D]}|�
|j�qWd�|S1s3wY|S)ak
    List all folders located in a specific location in the task scheduler.

    Args:

        location (str):
            A string value representing the folder from which you want to list
            tasks. Default is ``\`` which is the root for the task scheduler
            (``C:\Windows\System32\tasks``).

    Returns:
        list: Returns a list of folders.

    CLI Example:

    .. code-block:: bash

        # List all folders in the default location
        salt 'minion-id' task.list_folders

        # List all folders in the Microsoft directory
        salt 'minion-id' task.list_folders Microsoft
    rVrN)rrrWrXrYrZr[r\r]Z
GetFoldersr_r`)rarbrGZfoldersrcZfolderr!r!r"�list_folders�s

�
��recC�|tjj���.tj�d�}|��|�|�}|�	|�j
}|j}g}|D]}|�|j
�q#Wd�|S1s7wY|S)a
    List all triggers that pertain to a task in the specified location.

    Args:

        name (str):
            The name of the task for which list triggers.

        location (str):
            A string value representing the location of the task from which to
            list triggers. Default is ``\`` which is the root for the task
            scheduler (``C:\Windows\System32\tasks``).

    Returns:
        list: Returns a list of triggers.

    CLI Example:

    .. code-block:: bash

        # List all triggers for a task in the default location
        salt 'minion-id' task.list_triggers <task_name>

        # List all triggers for the XblGameSaveTask in the Microsoft\XblGameSave
        # location
        salt '*' task.list_triggers XblGameSaveTask Microsoft\XblGameSave
    rVN)rrrWrXrYrZr[r\r]�GetTask�
Definition�Triggersr_�Id)rFrarbrGrH�triggersrc�triggerr!r!r"�
list_triggers��
�
�
�
rmcCrf)a
    List all actions that pertain to a task in the specified location.

    Args:

        name (str):
            The name of the task for which list actions.

        location (str):
            A string value representing the location of the task from which to
            list actions. Default is ``\`` which is the root for the task
            scheduler (``C:\Windows\System32\tasks``).

    Returns:
        list: Returns a list of actions.

    CLI Example:

    .. code-block:: bash

        # List all actions for a task in the default location
        salt 'minion-id' task.list_actions <task_name>

        # List all actions for the XblGameSaveTask in the Microsoft\XblGameSave
        # location
        salt 'minion-id' task.list_actions XblGameSaveTask Microsoft\XblGameSave
    rVN)rrrWrXrYrZr[r\r]rgrh�Actionsr_rj)rFrarbrGrH�actionsrc�actionr!r!r"�list_actions�rnrr�Systemc		Ks�|t|�vr
|s
|�d�Stjj���Gtj�d�}|��|�	d�}t
d|||d�|��tdd|i|��tdd|i|��|�
|�}t||||jj||jjd�Wd�n1s]wY|t|�vS)	aE
    Create a new task in the designated location. This function has many keyword
    arguments that are not listed here. For additional arguments see:

        - :py:func:`edit_task`
        - :py:func:`add_action`
        - :py:func:`add_trigger`

    Args:

        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:\Windows\System32\tasks``).

        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.

    Returns:
        bool: ``True`` if successful, otherwise ``False``

    CLI Example:

    .. code-block:: bash

        salt 'minion-id' task.create_task <task_name> user_name=System force=True action_type=Execute cmd='del /Q /S C:\\Temp' trigger_type=Once start_date=2016-12-1 start_time='"01:00"'
    � already existsrVr)rHrIrJrH�rFrGrHrIrJrKNr!)rdrrrWrXrYrZr[r\ZNewTask�	edit_task�
add_action�add_triggerr]rT�	Principal�UserID�	LogonType)	rFrarIrJ�force�kwargsrbrHrGr!r!r"�create_task	s4+

��
��#r~cCs�|t|�vr|�d�S|s|std��tjj����tj�d�}|�	�|r(|}|�
|�}|rD|��dkr<t}d}d}n|rAt
}nt}nd}t}z|�||t|||�Wn�tjy�}	z||	j\}
}}}
t|d�}idd	�d
d�dd
�dd�dd�dd�dd�dd�dd�dd�dd�dd�d d!�d"d#�d$d%�d&d'�d(d)�d*d+d,��}z-z||}Wnty�d-t|���}YnwWt�d.|�t|��Wt�d.|�t|��t�d.|�wd}	~	wwWd�n1s�wY|t|�vS)/a�
    Create a task based on XML. Source can be a file or a string of XML.

    Args:

        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:\Windows\System32\tasks``).

        xml_text (str):
            A string of xml representing the task to be created. This will be
            overridden by ``xml_path`` if passed.

        xml_path (str):
            The path to an XML file on the local system containing the xml that
            defines the task. This will override ``xml_text``

        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.

    Returns:
        bool: ``True`` if successful, otherwise ``False``
        str: A string with the error message if there is an error

    Raises:
        ArgumentValueError: If arguments are invalid
        CommandExecutionError

    CLI Example:

    .. code-block:: bash

        salt '*' task.create_task_from_xml <task_name> xml_path=C:\task.xml
    rtz(Must specify either xml_text or xml_pathrV�system�SYSTEMNrr;r8r<r9r=r:l	zA task's trigger is not foundl
zIOne or more of the properties required to run this task have not been setlz<The Task Scheduler service is not installed on this computerl
z#The task object could not be openedlzCThe object is either an invalid task object or is not a task objectrzdNo account information could be found in the Task Scheduler security database for the task indicatedlz6Unable to establish existence of the account specifiedlz\Corruption was detected in the Task Scheduler security database; the database has been resetlz8The task object version is either unsupported or invalidlzeThe task has been configured with an unsupported combination of account settings and run time optionslz)The Task Scheduler Service is not runninglz(The task XML contains an unexpected nodelzJThe task XML contains an element or attribute from an unexpected namespacelzThe task XML is malformedzoThe task is registered, but may fail to start. Batch logon privilege needs to be enabled for the task principalz5The task XML contains too many nodes of the same type)ilr>zFailed to create task: %s)rdrrrrWrXrYrZr[r\r]�lower�TASK_LOGON_SERVICE_ACCOUNT�TASK_LOGON_PASSWORD�TASK_LOGON_INTERACTIVE_TOKEN�TASK_LOGON_NONEZRegisterTask�TASK_CREATEr@rArBr%rCrDrrEr)rFraZxml_textZxml_pathrIrJrbrGrKrLrMrNrOrPrQrRrSr!r!r"�create_task_from_xml_s�0

������	��
������� �!�%�'�,��������Yr�cCsv|t|�vr|�d�Stjj���tj�d�}|��|�	|�}|�
|�Wd�n1s0wY|t|�vS)a@
    Create a folder in which to create tasks.

    Args:

        name (str):
            The name of the folder. This will be displayed in the task
            scheduler.

        location (str):
            A string value representing the location in which to create the
            folder. Default is ``\`` which is the root for the task scheduler
            (``C:\Windows\System32\tasks``).

    Returns:
        bool: ``True`` if successful, otherwise ``False``

    CLI Example:

    .. code-block:: bash

        salt 'minion-id' task.create_folder <folder_name>
    rtrVN)rerrrWrXrYrZr[r\r]ZCreateFolder�rFrarbrGr!r!r"�
create_folder�s

�	r�c 	Kstjj�����d}|�dd�r|�d�}n5d}|s#	Wd�dS|t|�vr?tj�d�}|�	�|�
|�}|�|�j}n|�d�Wd�S|rUd|j
_d	|j
_|dur]||j
_|r�|��d
krlt}d}d}n||j_|rut}nt}||j_||j_||j_t|j_nd}d}|dur�||j_|dur�||j_|dur�||j_|jjr�|
dur�|
|jj _!|dur�||jj _"|dur�|t#vr�t$t#|�|jj _%n		Wd�dS|	dur�|	t#vr�t$t#|	�|jj _&n		Wd�d
S|dur�||j_'|
dur�|
|j_(|du�r||j_)|du�r||j_*|jj*�r%|�r||jj+_|�r%||jj+_,|du�r.||j_-|du�r7||j_.|du�r\|du�rFd|j_/n|t#v�rSt$t#|�|j_/n		Wd�dS|jj/�r||du�r||t0dd�v�rs||j_1n		Wd�dS|du�r�|du�r�d|j_2n|t#v�r�t$t#|�|j_2n		Wd�dS|du�r�||j_3|du�r�|du�r�d|j_4n|t#v�r�t$t#|�|j_4n		Wd�dS|du�r�t5||j_6|�r�t7||||||jjd�Wd�SWd�dS1�s�wYdS)a�
    Edit the parameters of a task. Triggers and Actions cannot be edited yet.

    Args:

        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:\Windows\System32\tasks``).

        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.

            .. note::

                The combination of user_name and password determine how the
                task runs. For example, if a username is passed without at
                password the task will only run when the user is logged in. If a
                password is passed as well the task will run whether the user is
                logged on or not. If you pass 'System' as the username the task
                will run as the system account (the password parameter is
                ignored).

        description (str):
            A string representing the text that will be displayed in the
            description field in the task scheduler.

        enabled (bool):
            A boolean value representing whether or not the task is enabled.

        hidden (bool):
            A boolean value representing whether or not the task is hidden.

        run_if_idle (bool):
            Boolean value that indicates that the Task Scheduler will run the
            task only if the computer is in an idle state.

        idle_duration (str):
            A value that indicates the amount of time that the computer must be
            in an idle state before the task is run. Valid values are:

                - 1 minute
                - 5 minutes
                - 10 minutes
                - 15 minutes
                - 30 minutes
                - 1 hour

        idle_wait_timeout (str):
            A value that indicates the amount of time that the Task Scheduler
            will wait for an idle condition to occur. Valid values are:

                - Do not wait
                - 1 minute
                - 5 minutes
                - 10 minutes
                - 15 minutes
                - 30 minutes
                - 1 hour
                - 2 hours

        idle_stop_on_end (bool):
            Boolean value that indicates that the Task Scheduler will terminate
            the task if the idle condition ends before the task is completed.

        idle_restart (bool):
            Boolean value that indicates whether the task is restarted when the
            computer cycles into an idle condition more than once.

        ac_only (bool):
            Boolean value that indicates that the Task Scheduler will launch the
            task only while on AC power.

        stop_if_on_batteries (bool):
            Boolean value that indicates that the task will be stopped if the
            computer begins to run on battery power.

        wake_to_run (bool):
            Boolean value that indicates that the Task Scheduler will wake the
            computer when it is time to run the task.

        run_if_network (bool):
            Boolean value that indicates that the Task Scheduler will run the
            task only when a network is available.

        network_id (guid):
            GUID value that identifies a network profile.

        network_name (str):
            Sets the name of a network profile. The name is used for display
            purposes.

        allow_demand_start (bool):
            Boolean value that indicates that the task can be started by using
            either the Run command or the Context menu.

        start_when_available (bool):
            Boolean value that indicates that the Task Scheduler can start the
            task at any time after its scheduled time has passed.

        restart_every (str):
            A value that specifies the interval between task restart attempts.
            Valid values are:

                - False (to disable)
                - 1 minute
                - 5 minutes
                - 10 minutes
                - 15 minutes
                - 30 minutes
                - 1 hour
                - 2 hours

        restart_count (int):
            The number of times the Task Scheduler will attempt to restart the
            task. Valid values are integers 1 - 999.

        execution_time_limit (bool, str):
            The amount of time allowed to complete the task. Valid values are:

                - False (to disable)
                - 1 hour
                - 2 hours
                - 4 hours
                - 8 hours
                - 12 hours
                - 1 day
                - 3 days

        force_stop (bool):
            Boolean value that indicates that the task may be terminated by
            using TerminateProcess.

        delete_after (bool, str):
            The amount of time that the Task Scheduler will wait before deleting
            the task after it expires. Requires a trigger with an expiration
            date. Valid values are:

                - False (to disable)
                - Immediately
                - 30 days
                - 90 days
                - 180 days
                - 365 days

        multiple_instances (str):
            Sets the policy that defines how the Task Scheduler deals with
            multiple instances of the task. Valid values are:

                - Parallel
                - Queue
                - No New Instance
                - Stop Existing

    Returns:
        bool: ``True`` if successful, otherwise ``False``

    CLI Example:

    .. code-block:: bash

        salt '*' task.edit_task <task_name> description='This task is awesome'
    FrHTN�$Required parameter "name" not passedrV�
 not foundzSalt MinionzSalt Minion Daemonrr�z!Invalid value for "idle_duration"z%Invalid value for "idle_wait_timeout"rz!Invalid value for "restart_every"r	i�z1"restart_count" must be a value between 1 and 999�PT0Sz(Invalid value for "execution_time_limit"z Invalid value for "delete_after"ru)8rrrWrX�getrdrYrZr[r\r]rgrhZRegistrationInfoZAuthorZSourceZDescriptionr�r�ryrjr�r�rzZDisplayNamer{�TASK_RUNLEVEL_HIGHESTZRunLevel�Settings�EnabledZHidden�
RunOnlyIfIdle�IdleSettings�
StopOnIdleEnd�
RestartOnIdle�durationr7�IdleDuration�WaitTimeout�DisallowStartIfOnBatteries�StopIfGoingOnBatteries�	WakeToRun�RunOnlyIfNetworkAvailable�NetworkSettingsr`�AllowDemandStart�StartWhenAvailable�RestartInterval�range�RestartCount�ExecutionTimeLimit�AllowHardTerminate�DeleteExpiredTaskAfter�	instances�MultipleInstancesrT) rFrarIrJ�description�enabledZhidden�run_if_idle�
idle_duration�idle_wait_timeout�idle_stop_on_end�idle_restart�ac_only�stop_if_on_batteries�wake_to_run�run_if_network�
network_id�network_name�allow_demand_start�start_when_availableZ
restart_every�
restart_count�execution_time_limit�
force_stop�delete_after�multiple_instancesr}�save_definitionrHrbrGrKr!r!r"rvsO�
�


��U��^











��
~

��




���





���
��� �$�rvcC�||t|�vr
|�d|��Stjj���tj�d�}|��|�	|�}|�
|d�Wd�n1s3wY|t|�vS)a�
    Delete a task from the task scheduler.

    Args:
        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:\Windows\System32\tasks``).

    Returns:
        bool: ``True`` if successful, otherwise ``False``

    CLI Example:

    .. code-block:: bash

        salt 'minion-id' task.delete_task <task_name>
    � not found in rVrN)rdrrrWrXrYrZr[r\r]Z
DeleteTaskr�r!r!r"�delete_task�s
�
r�cCr�)a
    Delete a folder from the task scheduler.

    Args:

        name (str):
            The name of the folder to delete.

        location (str):
            A string value representing the location of the folder.  Default is
            ``\`` which is the root for the task scheduler
            (``C:\Windows\System32\tasks``).

    Returns:
        bool: ``True`` if successful, otherwise ``False``

    CLI Example:

    .. code-block:: bash

        salt 'minion-id' task.delete_folder <folder_name>
    r�rVrN)rerrrWrXrYrZr[r\r]ZDeleteFolderr�r!r!r"�
delete_folder�s
�r�c	C�|t|�vr
|�d|��Stjj���5tj�d�}|��|�	|�}|�
|�}z|�d�WWd�dStj
yGYWd�dSw1sKwYdS)a�
    Run a scheduled task manually.

    Args:

        name (str):
            The name of the task to run.

        location (str):
            A string value representing the location of the task. Default is
            ``\`` which is the root for the task scheduler
            (``C:\Windows\System32\tasks``).

    Returns:
        bool: ``True`` if successful, otherwise ``False``

    CLI Example:

    .. code-block:: bash

        salt 'minion-id' task.run <task_name>
    r�rVrNTF)rdrrrWrXrYrZr[r\r]rg�Runr@rA�rFrarbrGrr!r!r"�run�� 


���r�c	Cs2|t|�vr
|�d|��Stjj���|tj�d�}|��|�	|�}|�
|�}|jtkr6	Wd�dSz|�
d�t�d�d}WntjyUYWd�dSw|r�d}z|�d	�}|jro|D]	}|j|krnd}qeWntjy|d}Ynw|sXWd�dSWd�dS1s�wYdS)
a�
    Run a scheduled task and return when the task finishes

    Args:

        name (str):
            The name of the task to run.

        location (str):
            A string value representing the location of the task. Default is
            ``\`` which is the root for the task scheduler
            (``C:\Windows\System32\tasks``).

    Returns:
        bool: ``True`` if successful, otherwise ``False``

    CLI Example:

    .. code-block:: bash

        salt 'minion-id' task.run_wait <task_name>
    r�rVNzTask already runningrr	TFr)rdrrrWrXrYrZr[r\r]rg�State�TASK_STATE_RUNNINGr��time�sleepr@rAZGetRunningTasksZCountr`)rFrarbrGrZrunningZ
running_tasks�itemr!r!r"�run_waitsL


�

�

���
��
��r�c	Cr�)a�
    Stop a scheduled task.

    Args:

        name (str):
            The name of the task to stop.

        location (str):
            A string value representing the location of the task. Default is
            ``\`` which is the root for the task scheduler
            (``C:\Windows\System32\tasks``).

    Returns:
        bool: ``True`` if successful, otherwise ``False``

    CLI Example:

    .. code-block:: bash

        salt 'minion-id' task.list_stop <task_name>
    r�rVrNTF)rdrrrWrXrYrZr[r\r]rgZStopr@rAr�r!r!r"�stopPr�r�cCs||t|�vr
|�d|��Stjj���!tj�d�}|��|�	|�}|�
|�}t|jWd�S1s7wYdS)a�
    Determine the status of a task. Is it Running, Queued, Ready, etc.

    Args:

        name (str):
            The name of the task for which to return the status

        location (str):
            A string value representing the location of the task. Default is
            ``\`` which is the root for the task scheduler
            (``C:\Windows\System32\tasks``).

    Returns:
        str: The current status of the task. Will be one of the following:

            - Unknown
            - Disabled
            - Queued
            - Ready
            - Running

    CLI Example:

    .. code-block:: bash

        salt 'minion-id' task.list_status <task_name>
    r�rVN)
rdrrrWrXrYrZr[r\r]rg�statesr�r�r!r!r"�status{s

$�r�c	Cs�|t|�vr
|�d|��Stjj�����tj�d�}|��|�	|�}|�
|�}t|j�}zt
|}WntyDdt|���}Ynw|jt|j�||jt|j�t|jd�}|jj}|j|jd�}	|jdkrnd|	d<n|jd	krxd
|	d<ntt|j�|	d<|jdks�|jd	kr�d|	d<ntt|j�|	d<tt|j �|	d<|j!dkr�d|	d
<ntt|j!�|	d
<|	d
r�|j"|	d<|j#|	d<|j$|	d<|j%|j&|j'|j(d�}
|
dr�|j)}|j*|
d<|j+|
d<|j,|
d<|j-|
d<|
dr�|j.}|j/|
d<|j0|
d<g}
|jj1D]+}dtt2|j3�i}|j4�r|j4|d<|j5�r|j5|d<|j6�r&|j6|d<|
�7|��qg}|jj8D]�}dtt9|j3�i}|j�rItt|j�|d<|j:�r^|j:�;dd �\}}||d!<||d"<|j<�rs|j<�;dd �\}}||d#<||d$<|j|d%<t=|d&��r�|j>�r�tt|j>�|d'<nd|d'<t=|d(��r�|j?�r�tt|j?�|d)<nd|d)<t=|d*��r�tt|j@jA�|d+<tt|j@jB�|d,<|j@jC|d-<|�7|��q3|	|d.<|
|d/<|
|d0<||d1<|}Wd2�|S1�s�wY|S)3a
    Get the details about a task in the task scheduler.

    Args:

        name (str):
            The name of the task for which to return the status

        location (str):
            A string value representing the location of the task. Default is
            ``\`` which is the root for the task scheduler
            (``C:\Windows\System32\tasks``).

    Returns:
        dict: A dictionary containing the task configuration

    CLI Example:

    .. code-block:: bash

        salt 'minion-id' task.info <task_name>
    r�rVzUnknown Task Result: )r�Zlast_runZlast_run_resultZmissed_runsZnext_runr�)r�r�rFr�r�rr�r�Zrestart_intervalr�r�r�)r�r�r�r�r�r�r�r�r�r�r�r��action_type�cmd�	argumentsZworking_dir�trigger_type�Tr	�
start_date�
start_time�end_date�end_timer��RandomDelay�random_delay�Delay�delay�
Repetition�repeat_duration�repeat_interval�repeat_stop_at_duration_end�settings�
conditionsrprkN)DrdrrrWrXrYrZr[r\r]rgr%ZLastTaskResult�resultsrCrDr�r,ZLastRunTimeZNumberOfMissedRunsZNextRunTimer�r�rhr�r�r�r�r5r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rjr`ro�action_typesZType�Path�	Arguments�WorkingDirectoryr_ri�
trigger_types�
StartBoundary�split�EndBoundary�hasattrr�r�r��Duration�Interval�StopAtDurationEnd)rFrarbrGrZlast_task_result_codeZlast_task_resultZ
propertiesZdef_setr�r�Zidle_setZnet_setrpZ	actionObjrqrkZ
triggerObjrlr�r�r�r�rcr!r!r"�info�s�


��	�



�
��

�


�








�

�����
���r�rc		Kstjj����od}|�dd�r|�d�}n5d}|s#	Wd�dS|t|�vr?tj�d�}|�	�|�
|�}|�|�j}n|�d�Wd�S|j
�t|�}t|tkr�d|_|�d	d�ri|�d	�|_n		Wd�d
S|�dd�|_|�d
d�|_n�t|tk�rd|_|�dd�r�|�d�|_n		Wd�dS|�dd�r�|�d�|_n		Wd�dS|�dd�s�|�dd�r�|�d�r�|�d�|_|�d�r�|�d�|_n		Wd�dS|�d�r�|�d�|_|�d�r�|�d�|_|�d��r|�d�|_|�d��r|�d�|_|�d��r|�d�|_n8t|tk�rVd|_|�dd��r6|�d�|_ n		Wd�dS|�dd��rM|�d�|_!n		Wd�dS|�rnt"||||j#j$d|j#j%d �Wd�SWd�dS1�szwYdS)!a�

    Add an action to a task.

    Args:

        name (str):
            The name of the task to which to add the action.

        location (str):
            A string value representing the location of the task. Default is
            ``\`` which is the root for the task scheduler
            (``C:\Windows\System32\tasks``).

        action_type (str):
            The type of action to add. There are three action types. Each one
            requires its own set of Keyword Arguments (kwargs). Valid values
            are:

                - Execute
                - Email
                - Message

    Required arguments for each action_type:

    **Execute**

        Execute a command or an executable

            cmd (str):
                (required) The command or executable to run.

            arguments (str):
                (optional) Arguments to be passed to the command or executable.
                To launch a script the first command will need to be the
                interpreter for the script. For example, to run a vbscript you
                would pass ``cscript.exe`` in the ``cmd`` parameter and pass the
                script in the ``arguments`` parameter as follows:

                    - ``cmd='cscript.exe' arguments='c:\scripts\myscript.vbs'``

                Batch files do not need an interpreter and may be passed to the
                cmd parameter directly.

            start_in (str):
                (optional) The current working directory for the command.

    **Email**

        Send and email. Requires ``server``, ``from``, and ``to`` or ``cc``.

            from (str): The sender

            reply_to (str): Who to reply to

            to (str): The recipient

            cc (str): The CC recipient

            bcc (str): The BCC recipient

            subject (str): The subject of the email

            body (str): The Message Body of the email

            server (str): The server used to send the email

            attachments (list):
                A list of attachments. These will be the paths to the files to
                attach. ie: ``attachments="['C:\attachment1.txt',
                'C:\attachment2.txt']"``

    **Message**

        Display a dialog box. The task must be set to "Run only when user is
        logged on" in order for the dialog box to display. Both parameters are
        required.

            title (str):
                The dialog box title.

            message (str):
                The dialog box message body

    Returns:
        dict: A dictionary containing the task configuration

    CLI Example:

    .. code-block:: bash

        salt 'minion-id' task.add_action <task_name> cmd='del /Q /S C:\\Temp'
    FrHTNr�rVr�ZExecute_ID1r�z"Required parameter "cmd" not foundr�rZstart_inZ	Email_ID1Zserverz%Required parameter "server" not found�fromz#Required parameter "from" not found�toZccz)Required parameter "to" or "cc" not foundZreply_toZbcc�subject�body�attachmentsZMessage_ID1�titlez$Required parameter "title" not found�messagez&Required parameter "message" not foundru)&rrrWrXr�rdrYrZr[r\r]rgrhro�Creater��TASK_ACTION_EXECrjr�r�r��TASK_ACTION_SEND_EMAILZServerZFromZToZCcZReplyToZBccZSubjectZBodyZAttachments�TASK_ACTION_SHOW_MESSAGEZTitleZMessageBodyrTryrzr{)	rFrar�r}r�rHrbrGZtask_actionr!r!r"rwQs�]�
��#�/�4

��
=
��P�V��V$�rwc	C�|t|�vr
|�d|��Stjj���2tj�d�}|��|�	|�}|�
|�j}|j}|�
�t||||jjd|jjd�Wd�S1sHwYdS)as
    Remove all actions from the task.

    :param str name: The name of the task from which to clear all actions.

    :param str location: A string value representing the location of the task.
    Default is ``\`` which is the root for the task scheduler
    (``C:\Windows\System32\tasks``).

    :return: True if successful, False if unsuccessful
    :rtype: bool
    r�rVNru)rdrrrWrXrYrZr[r\r]rgrhro�ClearrTryrzr{)rFrarbrGrHrpr!r!r"�_clear_actionss$
�$�r�c&Ks�|sdSddddddd�}idd�dd�dd�dd�d	d
�dd�dd
�dd�dd�dd�dd�dd�dd�dd�dd�d
d�dd�d d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/��}ddddd
dd
d0�}ddddd1�}ddddd
dd
dddddd2�}|r�t|�}|r�t�||�}nd3St��}|r�t|�}|r�t�||�}nd4St�d5d6�}d7�|�d8�|�d6��}d9}|r�t|�}|r�t�||�}nd:S|r�t|�}|r�t�||�}nd;St�d5d6�}d9}|r�|r�d7�|�d8�|�d6��}tjj�	���zd<}|�
d=d<�r�|�
d=�}n7d>}|�s	Wd9�d?S|t|�v�r)tj
�d@�}|��|�|�}|�|�j}n|�dA�Wd9�S|j�t|�}||_|
�rItt|
�|_|�rRtt|�|_|	�rjtt|	�|j_|
�rftt|
�|j_||j_|�rstt|�|_|�ry||_ ||_!t|t"k�r�|�
dBd<��r�dC|_#|�
dB�|_$�n�	Wd9�dDSt|t%k�r�dE|_#�n�t|t&k�r�dF|_#|�
dGd�|_'�n�t|t(k�r�dH|_#|�
dId�|_)|�
dJd<��r�dK}|�
dJ�D]	} ||| O}�q�||_*�n^	Wd9�dLSt|t+k�r^dM|_#|�
dNd<��rdK}!|�
dN�D]	}"|!||"O}!�q|!|_,n		Wd9�dOS|�
dPd<��s1|�
dQd<��rT|�
dPd<��rLdK}|�
dP�D]	}#|||#O}�q?||_-|�
dQd<�|_.n�		Wd9�dRSt|t/k�r�dS|_#|�
dNd<��r�dK}!|�
dN�D]	}"|!||"O}!�qv|!|_,n		Wd9�dOS|�
dTd<��s�|�
dUd<��r�|�
dTd<��r�dK}$|�
dT�D]	}%|$||%O}$�q�|$|_0|�
dUd<�|_1n
		Wd9�dVS|�
dJd<��r�dK}|�
dJ�D]	} ||| O}�q�||_*ne	Wd9�dLSt|t2k�r�dW|_#nQt|t3k�rdX|_#nFt|t4k�rdY|_#n;t|t5k�rdZ|_#n0t|t6k�rId[|_#|�
d\d<��r0|�
d\�|_7|�
d]d<��r@||�
d]�|_8n		Wd9�d^S|�rat9||||j:j;d9|j:j<d_�Wd9�SWd9�d9S1�smwYd9S)`a�&
    Add a trigger to a Windows Scheduled task

    .. note::

        Arguments are parsed by the YAML loader and are subject to
        yaml's idiosyncrasies. Therefore, time values in some
        formats (``%H:%M:%S`` and ``%H:%M``) should to be quoted.
        See `YAML IDIOSYNCRASIES`_ for more details.

    .. _`YAML IDIOSYNCRASIES`: https://docs.saltproject.io/en/latest/topics/troubleshooting/yaml_idiosyncrasies.html#time-expressions

    Args:

        name (str):
            The name of the task to which to add the trigger.

        location (str):
            A string value representing the location of the task. Default is
            ``\`` which is the root for the task scheduler
            (``C:\Windows\System32\tasks``).

        trigger_type (str):
            The type of trigger to create. This is defined when the trigger is
            created and cannot be changed later. Options are as follows:

                - Event
                - Once
                - Daily
                - Weekly
                - Monthly
                - MonthlyDay
                - OnIdle
                - OnTaskCreation
                - OnBoot
                - OnLogon
                - OnSessionChange

        trigger_enabled (bool):
            Boolean value that indicates whether the trigger is enabled.

        start_date (str):
            The date when the trigger is activated. If no value is passed, the
            current date will be used. Can be one of the following formats:

                - %Y-%m-%d
                - %m-%d-%y
                - %m-%d-%Y
                - %m/%d/%y
                - %m/%d/%Y
                - %Y/%m/%d

        start_time (str):
            The time when the trigger is activated. If no value is passed,
            midnight will be used. Can be one of the following formats:

                - %I:%M:%S %p
                - %I:%M %p
                - %H:%M:%S
                - %H:%M

        end_date (str):
            The date when the trigger is deactivated. The trigger cannot start
            the task after it is deactivated. Can be one of the following
            formats:

                - %Y-%m-%d
                - %m-%d-%y
                - %m-%d-%Y
                - %m/%d/%y
                - %m/%d/%Y
                - %Y/%m/%d

        end_time (str):
            The time when the trigger is deactivated. If this is not passed
            with ``end_date`` it will be set to midnight. Can be one of the
            following formats:

                - %I:%M:%S %p
                - %I:%M %p
                - %H:%M:%S
                - %H:%M

        random_delay (str):
            The delay time that is randomly added to the start time of the
            trigger. Valid values are:

                - 30 seconds
                - 1 minute
                - 30 minutes
                - 1 hour
                - 8 hours
                - 1 day

            .. note::

                This parameter applies to the following trigger types

                    - Once
                    - Daily
                    - Weekly
                    - Monthly
                    - MonthlyDay

        repeat_interval (str):
            The amount of time between each restart of the task. Valid values
            are:

                - 5 minutes
                - 10 minutes
                - 15 minutes
                - 30 minutes
                - 1 hour

        repeat_duration (str):
            How long the pattern is repeated. Valid values are:

                - Indefinitely
                - 15 minutes
                - 30 minutes
                - 1 hour
                - 12 hours
                - 1 day

        repeat_stop_at_duration_end (bool):
            Boolean value that indicates if a running instance of the task is
            stopped at the end of the repetition pattern duration.

        execution_time_limit (str):
            The maximum amount of time that the task launched by the trigger is
            allowed to run. Valid values are:

                - 30 minutes
                - 1 hour
                - 2 hours
                - 4 hours
                - 8 hours
                - 12 hours
                - 1 day
                - 3 days (default)

        delay (str):
            The time the trigger waits after its activation to start the task.
            Valid values are:

                - 15 seconds
                - 30 seconds
                - 1 minute
                - 30 minutes
                - 1 hour
                - 8 hours
                - 1 day

            .. note::

                This parameter applies to the following trigger types:

                    - OnLogon
                    - OnBoot
                    - Event
                    - OnTaskCreation
                    - OnSessionChange

    **kwargs**

    There are optional keyword arguments determined by the type of trigger
    being defined. They are as follows:

    *Event*

        The trigger will be fired by an event.

            subscription (str):
                An event definition in xml format that fires the trigger. The
                easiest way to get this would is to create an event in Windows
                Task Scheduler and then copy the xml text.

    *Once*

        No special parameters required.

    *Daily*

        The task will run daily.

            days_interval (int):
                The interval between days in the schedule. An interval of 1
                produces a daily schedule. An interval of 2 produces an
                every-other day schedule. If no interval is specified, 1 is
                used. Valid entries are 1 - 999.

    *Weekly*

        The task will run weekly.

            weeks_interval (int):
                The interval between weeks in the schedule. An interval of 1
                produces a weekly schedule. An interval of 2 produces an
                every-other week schedule. If no interval is specified, 1 is
                used. Valid entries are 1 - 52.

            days_of_week (list):
                Sets the days of the week on which the task runs. Should be a
                list. ie: ``['Monday','Wednesday','Friday']``. Valid entries are
                the names of the days of the week.

    *Monthly*

        The task will run monthly.

            months_of_year (list):
                Sets the months of the year during which the task runs. Should
                be a list. ie: ``['January','July']``. Valid entries are the
                full names of all the months.

            days_of_month (list):
                Sets the days of the month during which the task runs. Should be
                a list. ie: ``[1, 15, 'Last']``. Options are all days of the
                month 1 - 31 and the word 'Last' to indicate the last day of the
                month.

            last_day_of_month (bool):
                Boolean value that indicates that the task runs on the last day
                of the month regardless of the actual date of that day.

                .. note::

                    You can set the task to run on the last day of the month by
                    either including the word 'Last' in the list of days, or
                    setting the parameter 'last_day_of_month' equal to ``True``.

    *MonthlyDay*

        The task will run monthly on the specified day.

            months_of_year (list):
                Sets the months of the year during which the task runs. Should
                be a list. ie: ``['January','July']``. Valid entries are the
                full names of all the months.

            weeks_of_month (list):
                Sets the weeks of the month during which the task runs. Should
                be a list. ie: ``['First','Third']``. Valid options are:

                    - First
                    - Second
                    - Third
                    - Fourth

            last_week_of_month (bool):
                Boolean value that indicates that the task runs on the last week
                of the month.

            days_of_week (list):
                Sets the days of the week during which the task runs. Should be
                a list. ie: ``['Monday','Wednesday','Friday']``.  Valid entries
                are the names of the days of the week.

    *OnIdle*

        No special parameters required.

    *OnTaskCreation*

        No special parameters required.

    *OnBoot*

        No special parameters required.

    *OnLogon*

        No special parameters required.

    *OnSessionChange*

        The task will be triggered by a session change.

            session_user_name (str):
                Sets the user for the Terminal Server session. When a session
                state change is detected for this user, a task is started. To
                detect session status change for any user, do not pass this
                parameter.

            state_change (str):
                Sets the kind of Terminal Server session change that would
                trigger a task launch. Valid options are:

                    - ConsoleConnect: When you connect to a user session (switch
                      users)
                    - ConsoleDisconnect: When you disconnect a user session
                      (switch users)
                    - RemoteConnect: When a user connects via Remote Desktop
                    - RemoteDisconnect: When a user disconnects via Remote
                      Desktop
                    - SessionLock: When the workstation is locked
                    - SessionUnlock: When the workstation is unlocked

    Returns:
        bool: ``True`` if successful, otherwise ``False``

    CLI Example:

    .. code-block:: bash

        salt 'minion-id' task.add_trigger <task_name> trigger_type=Once trigger_enabled=True start_date=2016/12/1 start_time='"12:01"'
    z/Required parameter "trigger_type" not specifiedr	r
rrrr
)ZConsoleConnectZConsoleDisconnectZ
RemoteConnectZRemoteDisconnectZSessionLockZ
SessionUnlockrrrr�@�r�riri�i�
i�i �i@i��iiiiii i@i�iiiiii i@l)��������������ZLast)ZSundayZMondayZTuesdayZ	WednesdayZThursdayZFridayZSaturday)ZFirstZSecondZThirdZFourth)�January�FebruaryZMarchZApril�MayZJuneZJulyZAugustZ	SeptemberZOctoberZNovemberZDecemberzInvalid start_datezInvalid start_timez00:00:00r&z{}T{}r'NzInvalid end_datezInvalid end_timeFrHTr�rVr�ZsubscriptionZ	Event_ID1z,Required parameter "subscription" not passedZOnce_ID1Z	Daily_ID1Z
days_intervalZ
Weekly_ID1Zweeks_intervalZdays_of_weekrz,Required parameter "days_of_week" not passedZMonthly_ID1Zmonths_of_yearz.Required parameter "months_of_year" not passedZ
days_of_monthZlast_day_of_monthzJMonthly trigger requires "days_of_month" or "last_day_of_month" parametersZMonthly_DOW_ID1Zweeks_of_monthZlast_week_of_monthzPMonthly DOW trigger requires "weeks_of_month" or "last_week_of_month" parametersZ
OnIdle_ID1ZOnTaskCreation_ID1Z
OnBoot_ID1ZOnLogon_ID1ZOnSessionStateChange_ID1Zsession_user_nameZstate_changez,Required parameter "state_change" not passedru)=r*rr(�now�format�strftimerrrWrXr�rdrYrZr[r\r]rgrhrir�r�r�r7r�r�r�r�r�r�r�r�r�r��TASK_TRIGGER_EVENTrjZSubscription�TASK_TRIGGER_TIME�TASK_TRIGGER_DAILYZDaysInterval�TASK_TRIGGER_WEEKLYZ
WeeksIntervalZ
DaysOfWeek�TASK_TRIGGER_MONTHLYZMonthsOfYearZDaysOfMonthZRunOnLastDayOfMonth�TASK_TRIGGER_MONTHLYDOWZWeeksOfMonthZRunOnLastWeekOfMonth�TASK_TRIGGER_IDLE�TASK_TRIGGER_REGISTRATION�TASK_TRIGGER_BOOT�TASK_TRIGGER_LOGON�!TASK_TRIGGER_SESSION_STATE_CHANGEZUserIdZStateChangerTryrzr{)&rFrar�Ztrigger_enabledr�r�r�r�r�r�r�r�r�r�r}Z
state_changes�daysZweekdays�weeks�monthsZdate_formatZdt_obj�time_formatZtm_objZstart_boundaryZend_boundaryr�rHrbrGrlZ	bits_days�weekdayZbits_months�month�dayZ
bits_weeks�weekr!r!r"rx>s�F�	��������	�
���
������$�
����
��;

�P�Z���j�t�����
��'���'�$�rxc	Cr�)a

    Remove all triggers from the task.

    Args:

        name (str):
            The name of the task from which to clear all triggers.

        location (str):
            A string value representing the location of the task. Default is
            ``\`` which is the root for the task scheduler
            (``C:\Windows\System32\tasks``).

    Returns:
        bool: ``True`` if successful, otherwise ``False``

    CLI Example:

    .. code-block:: bash

        salt 'minion-id' task.clear_trigger <task_name>
    r�rVNru)rdrrrWrXrYrZr[r\r]rgrhrir�rTryrzr{)rFrarbrGrHrkr!r!r"�clear_triggers�	s$
�$�r,)rU)rUrsNF)rUNNrsN)NrUNNNNNNNNNNNNNNNNNNNrNNNN)NrUr)NrUNTNNNNNNNFNN)`�__doc__�loggingr�rZsalt.utils.platformrZsalt.utils.winapiZsalt.exceptionsrrr@r^Zwin32com.clientrYr�ImportError�	getLogger�__name__rr r�ZTASK_ACTION_COM_HANDLERr�r�ZTASK_COMPATIBILITY_ATZTASK_COMPATIBILITY_V1ZTASK_COMPATIBILITY_V2ZTASK_COMPATIBILITY_V3ZTASK_VALIDATE_ONLYr�ZTASK_UPDATEr?ZTASK_DISABLEZTASK_DONT_ADD_PRINCIPAL_ACEZ!TASK_IGNORE_REGISTRATION_TRIGGERSZTASK_INSTANCES_PARALLELZTASK_INSTANCES_QUEUEZTASK_INSTANCES_IGNORE_NEWZTASK_INSTANCES_STOP_EXISTINGr�r�ZTASK_LOGON_S4Ur�ZTASK_LOGON_GROUPr�Z(TASK_LOGON_INTERACTIVE_TOKEN_OR_PASSWORDZTASK_RUNLEVEL_LUAr�ZTASK_STATE_UNKNOWNZTASK_STATE_DISABLEDZTASK_STATE_QUEUEDZTASK_STATE_READYr�rrrrrrrr r!r"r#r�r�r�r�r�r�r#r%r*r,r5r7rTrdrermrrr~r�r�rvr�r�r�r�r�r�r�rwr�rxr,r!r!r!r"�<module>s�
�
��������	�
���
���������	���������	�
���
����	!
8
.
(
-.
�W
�
+
�
{
(
*
+
=
+
-
*
@/
�s