Integration

Table Of Contents
VMware, Inc. 83
Chapter 7 Dynamically Setting Desktop Policies with Start Session Scripts
Enable the VMware View Script Host Service
You must configure the VMware View Script Host service to be enabled on each View desktop virtual machine
where you want View to run the start session script. By default, the VMware View Script Host service is
disabled.
To configure the VMware View Script Host service
1Start the Windows Services tool by entering services.msc at the command prompt.
2 In the details pane, right-click on the VMware View Script Host service entry and select Properties.
3On the General tab, in Startup type, select Automatic.
4 If you do not want the local system account to run the start session script, select This account, and enter
the details of the account to run the start session script.
5Click OK and exit the Services tool.
Configure a User Account to Run the Start Session Script
Optionally, you can change the user account under which the start session scripts run. Start session scripts run
in the context of the VMware View Script Host service. By default, this service is configured to run as the
SYSTEM user.
It is important to remember that start session scripts are run outside a desktop user session and not by the
desktop user account. Information is sent directly from the client computer within a script running as the
SYSTEM user.
Make sure that the path where you configure your start session scripts is accessible only to the SYSTEM
account and to local administrators. (Set the ACL for the base key to be accessible to these accounts only.)
As a best practice, place the start session scripts in the following location:
View_Agent_install_path
\scripts
For example: %ProgramFiles%\VMware\VMware View\Agent\scripts\sample.vbs
By default, this folder is accessible only by the SYSTEM and administrator accounts.
Add Windows Registry Entries for a Start Session Script
To make a start session script available for execution, you must add the path to the script in the Windows
registry. You also must add and enable a start session value, RunScriptsOnStartSession, in the registry. To
prevent scripts from timing out, you should set a registry value to specify timeout values in seconds rather
than minutes. Finally, you can set additional, optional entries to govern timeout values.
You must create these registry entries on each View desktop virtual machine where you want to run a start
session script.
To add Windows registry entries to enable a start session script on a View desktop virtual machine
1 Start the Windows Registry Editor by entering regedit at the command prompt.
2 In the registry, navigate to HKLM\SOFTWARE\VMware, Inc.\VMware VDM\ScriptEvents.
3 In the navigation area, right-click ScriptEvents, select New > Key, and create a key named StartSession.
4 In the navigation area, right-click StartSession, select New > String Value, and create a string value that
identifies the start session script to be run. For example: SampleScript
To run more than one start session script, create a string value entry for each script under the StartSession
key. You cannot specify the order in which these scripts run. If the scripts must run in a specified order,
invoke them from a single control script.
5 In the topic area, right-click on the entry for the new string value and select Modify.