Select tasks that are triggered when certain actions are performed in the user environment.

About this task

With triggers, a user can unplug a laptop, move it to another location, plug it in again, and maintain their current session while making use of more appropriate infrastructure resources. Triggers also provide a seamless experience for users who log in to the same virtual desktop session from different devices.

When running in a remote session, the following special environment variables are available for use in custom commands or messages:

  • %CURRENT_CLIENTIP%

    The endpoint IP address.

  • %PREVIOUS_CLIENTIP%

    The previous endpoint IP address. This variable only exists for the Reconnect session trigger and if the user is connecting from a different client.

  • %CURRENT_CLIENTNAME%

    The endpoint name.

Procedure

  1. Start the User Environment Manager Management Console.
  2. Open the User Environment tab.
  3. Select Triggered Tasks and click Create.
  4. Enter a name for the settings definition.
  5. Configure the triggered task settings.

    Option

    Description

    Trigger

    Select the event that is used to trigger this task.

    • Lock workstation

    • Unlock workstation

    • Disconnect session

    • Reconnect session

    Only applies if (endpoint) IP has changed

    (Optional) If Unlock workstation or Reconnect session is selected, this additional setting controls whether the task is performed always, or only if the IP address for Unlock workstation and endpoint IP address for Reconnect session changed since the session was disconnected. This option can be used to perform tasks when the user network location has changed.

    Action

    • DirectFlex refresh

      DirectFlex configuration is normally only processed during login, and any changes made while a user is logged in are not picked up during the session. To re-read the DirectFlex configuration while a user is logged in, configure a triggered task to perform a DirectFlex refresh.

    • User Environment refresh

      Certain user environment settings can be refreshed during the session. The Refresh setting controls which types of settings are refreshed: ADMX-based Settings, Application Blocking Settings, Drive Mappings, Environment Variables, File Type Associations, Horizon Smart Policies, Printer Mappings, Privilege Elevation Settings, Shortcuts, and Triggered Task Settings.

      Note:

      Refreshing Horizon Smart Policies is best performed at the Reconnect session trigger, to ensure that the Horizon remote desktop experience components pick up the new policies.

    • Run custom command

      Select this action to start a custom command. The Command setting can contain environment variables. You can enter arguments to the command through the Arguments setting.

    • Display message

      Select this action to display a message.

    Show message

    Controls whether a message is displayed when the selected action is performed.

    Caption

    Specifies the caption of the message dialog box. Can contain environment variables.

    Message

    Specifies the message text. Can consist of multiple lines and can contain environment variables.

    Close automatically after

    (Optional) If this setting is configured, the message will automatically disappear after the specified number of seconds, otherwise the message remains on the screen until the user closes it.

    Also allow user to dismiss message

    (Optional) If Close automatically after is configured, this setting controls whether the user can close the message before the timeout has expired.

  6. Click Save.