Integration

Table Of Contents
Setting Desktop Policies with Start
Session Scripts 7
With start session scripts, you can congure specic View desktop seings before a desktop session starts
based on information received from Horizon Client and View Connection Server.
For example, you can use a start session script to congure desktop policies based on client device and user
location instead of seing up multiple desktop pools that have dierent desktop policies. A start session
script can enable mapped drives, clipboard redirection, and other desktop features for a user who has an IP
address in your organization’s internal domain, but disallow these features for a user who has an IP address
in an external domain.
This chapter includes the following topics:
n
“Obtaining Input Data for a Start Session Script,” on page 83
n
“Best Practices for Using Start Session Scripts,” on page 83
n
“Preparing a View Desktop to Use a Start Session Script,” on page 84
n
“Sample Start Session Scripts,” on page 86
Obtaining Input Data for a Start Session Script
Start session scripts cannot run interactively. A start session script runs in an environment created by View
and must obtain its input data from that environment.
Start session scripts gather input data from environment variables on the client computer. Start session
environment variables have the prex VDM_StartSession_. For example, the start session environment
variable that contains the client system’s IP address is VDM_StartSession_IP_Address. You must ensure that a
start session script validates the existence of any environment variable that it uses.
For a list of variables similar to start session environment variables, see “Client System Information Sent to
View Desktops” in the Conguring Remote Desktop Features in Horizon 7 document.
Best Practices for Using Start Session Scripts
Follow these best practices when using start session scripts.
When to Use Start Session Scripts
Use start session scripts only if you need to congure desktop policies before a session starts.
As a best practice, use the Horizon Agent CommandsToRunOnConnect and CommandsToRunOnReconnect group
policy seings to run command scripts after a desktop session is connected or reconnected. Running scripts
within a desktop session, rather than using start session scripts, satises most use cases.
For more information, see “Running Commands on View Desktops” in the Conguring Remote Desktop
Features in Horizon 7 document.
VMware, Inc.
83