Integration
Table Of Contents
- View Integration
- Contents
- Introduction
- Integrating with the Event Database
- Using View PowerCLI
- Introduction to View PowerCLI
- View PowerCLI Cmdlets
- View Administrator, View PowerCLI Cmdlet, and vdmadmin Operations
- View PowerCLI Cmdlet Parameters
- Examples of Using View PowerCLI Cmdlets
- Displaying Information About a View Connection Server Instance
- Updating the Configuration of a View Connection Server Instance
- Managing the Configuration of vCenter Servers in View
- Managing Desktop Pools
- Creating and Updating Automatically Provisioned Desktop Pools
- Creating and Updating Linked-Clone Desktop Pools
- Creating and Updating Manually Provisioned Desktop Pools
- Creating Manual Unmanaged Desktop Pools
- Creating and Updating Desktops Provisioned by RDS Hosts
- Obtaining Information About Users and Groups from Active Directory
- Managing Desktop Entitlements
- Managing Remote Sessions
- Managing Virtual Machines
- Displaying Information About Physical Computers
- Updating the Ownership of Machines
- Displaying Information About Events
- Managing the Global Configuration of View
- Managing View Licenses
- Examples of Using View PowerCLI for Enhanced Functionality
- Assign Multiple Network Labels to a Desktop Pool
- Customizing LDAP Data
- Integrating with SCOM
- View Management Packs
- Name a View Connection Server Group
- Import the View MPs
- View Discovery Script
- Run the Discovery Script
- Display Discovered Objects
- Display Managed Objects
- Views and Monitors
- Enable a Proxy Agent on a Server
- Display Performance Data
- Display Information About an Alert
- Restart a Service
- Exclude a Domain from Connectivity Monitoring
- Close Alerts
- Class and Relationship Definitions
- Examining PCoIP Session Statistics
- Dynamically Setting Desktop Policies with Start Session Scripts
- Index
View Integration
82 VMware, Inc.
Example Start Session Scripts
Start session scripts cannot run interactively. A start session script runs in an environment created by View,
and the script must obtain its input data from this environment. The input data is gathered from environment
variables on the client computer.
For a list of similar variables, see “Client System Information Sent to View Desktops” in the Setting Up Desktop
and Application Pools in View document. Note that start session variables have the prefix VDM_StartSession_
instead of ViewClient_. For example, the start session variable containing the client system’s IP address is
VDM_StartSession_IP_Address.
You should ensure that a start session script validates the existence of any environment variable that it uses.
The following sample Visual Basic script writes all the environment variables being provided to the script into
a file, so that you can see example data in your own environment:
Option Explicit
Dim WshShell, FSO, outFile, strOutputFile, objUserEnv, strEnv
strOutputFile = "c:\setvars.txt"
Set FSO = CreateObject("Scripting.fileSystemObject")
Set outFile = FSO.CreateTextFile(strOutputFile, TRUE)
outFile.WriteLine("Script was called at (" & Now & ")")
Set WshShell = CreateObject( "WScript.Shell" )
Set objUserEnv = WshShell.Environment("PROCESS")
For Each strEnv In objUserEnv
outFile.WriteLine(strEnv)
Next
outFile.Close
You might save the preceding sample script as c:\sample.vbs.
The following sample script tests the timeout functionality:
Option Explicit
WScript.Sleep 60000
The following sample script tests a non-zero exit code:
Option Explicit
WScript.Quit 2
NOTE Make sure your start session scripts run quickly.
If you set the WaitScriptsOnStartSession value in the Windows registry, your start session script must
finish running before View Agent can respond to the StartSession message sent from View Connection Server.
A long-running script is likely to cause the StartSession request from View Connection Server to time out. If a
timeout occurs, View Connection Server tries to connect the user to another virtual machine (if the pool uses
floating assignments) or, if no virtual machine is available, to reject the user’s connection request.
In addition, you should set a hard timeout for the script host operation so that, if a script does run too long, a
specific error can be returned.