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 execute 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 specifiy 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 execute 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.

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. Controls whether WEM runs the task only once. By default, WEM runs an external task once. You need to select the option if you have many external tasks assigned to your users. Doing so reduces the agent refresh time.

Execution Order. Lets you specify the order of execution for each task. The option can be useful when you have multiple tasks assigned to users and some tasks rely on others to run successfully. By default, the value is 0.

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 executed 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/.