External Tasks

Controls the execution of external tasks. External tasks include running scripts and applications as long as the agent host has the corresponding programs to run them. Commonly used scripts include: .vbs and .cmd scripts.

With the external tasks feature, you can specify when to run an external task. Doing so lets you more effectively manage user environments.

Tip:

You can use dynamic tokens to extend Workspace Environment Management actions to make them more powerful.

External task list

A list of your existing external tasks. You can use Find to filter the list by name or ID against a text string.

To add an external task

  1. Use the context menu Add command.
  2. Enter details in the New External Task dialog tabs, then click OK.

Fields and controls

Name. Lets you specify the display name of the external task, which appears in the external task list.

Description. Lets you specify additional information about the external task.

Path. Lets you specify the path to the external task. The path resolves in the user environment. Make sure that:

  • The path you specified here is consistent with the agent host.
  • The agent host has the corresponding program to run the task.

Arguments. Lets you specify launch parameters or arguments. You can type a string. The string contains arguments to pass to the target script or application. For examples to use the Path and Arguments fields, see External task examples.

External Task State. Controls whether the external task is enabled or disabled. When disabled, the agent does not process the task even if the task is assigned to users.

Process on

  • Refresh. Controls whether to run the external task when users refresh the agent. By default, the option is selected.

  • Reconnect. Controls whether to run the external task when a user reconnects to a machine on which the agent is running. By default, the option is selected. If the WEM agent is installed on a physical Windows device, this option is not applicable.

  • Logon. Controls whether to run the external task when users log on. By default, the option is selected.

  • Logoff. Controls whether to run the external task when users log off. This option does not work unless Citrix User Logon Service is running. By default, the option is not selected.

Run Hidden. If selected, the task runs in the background and is not displayed to users.

Run Once. If selected, WEM runs the task only once regardless of which options you select in the Process On section and regardless of whether agents restart. By default, this option is selected.

Execution Order. Lets you specify the running order of each task. The option can be useful when you have multiple tasks assigned to users and some of those tasks rely on others to run successfully. By default, the value is 0. Tasks with an execution order value of 0 (zero) run first, then those with a value of 1, then those with a value of 2, and so on.

Wait for Task Completion. Lets you specify how long the agent waits for the task to complete. By default, the Wait Timeout value is 30 seconds.

Action Type. Describes what type of action the external task is.

Troubleshooting

After you enable the feature, the WEM agent creates a log file named Citrix WEM Agent Logoff.log the first time a user logs off. The log file is located in a user’s profile root folder. The WEM agent writes information to the log file every time the user logs off. The information helps you monitor and troubleshoot issues related to external tasks.

External task examples

For a script (for example, PowerShell script):

  • If neither the folder path nor the script name contains blank spaces:
    • In the Path field, type the following: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe.
    • In the Arguments field, type the following: C:\<folder path>\<script name>.ps1.

    Alternatively, you can type the path to the script file directly in the Path field. For example: C:\<folder path>\<script name>.ps1. In the Arguments field, specify arguments if needed. However, whether the script file is run or opens with a different program depends on file type associations configured in the user environment. For information about file type associations, see File Associations.

  • If the folder path or the script name contains blank spaces:
    • In the Path field, type the following: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe.
    • In the Arguments field, type the following: -file C:\<folder path>\<script name>.ps1.

For an application (for example, iexplore.exe):

  • In the Path field, type the following: C:\Program Files\"Internet Explorer"\iexplore.exe.
  • In the Arguments field, type the URL of the website to open: https://docs.citrix.com/.
External Tasks