Integration

Table Of Contents
Setting Desktop Policies with Start
Session Scripts 7
With start session scripts, you can configure specific View desktop settings 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 configure desktop policies based on client device and user
location instead of setting up multiple desktop pools that have different 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 81
n
“Best Practices for Using Start Session Scripts,” on page 81
n
“Preparing a View Desktop to Use a Start Session Script,” on page 82
n
“Sample Start Session Scripts,” on page 84
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 prefix 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 Setting Up Desktop and Application Pools in View 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 configure desktop policies before a session starts.
As a best practice, use the View Agent CommandsToRunOnConnect and CommandsToRunOnReconnect group policy
settings to run command scripts after a desktop session is connected or reconnected. Running scripts within
a desktop session, rather than using start session scripts, satisfies most use cases.
For more information, see “Running Commands on View Desktops” in the Setting Up Desktop and
Application Pools in View document.
VMware, Inc.
81