Examples of Using PowerShell cmdlets to Examine PCoIP Statistics 42
VMware, Inc.
Setting Desktop Policies with Start Session Scripts43
5
Obtaining Input Data for a Start Session Script 43
Best Practices for Using Start Session Scripts 43
Preparing a View Desktop to Use a Start Session Script 44
Sample Start Session Scripts 47
3
View Integration
The View Integration document describes how to integrate View™ software with third-party software such
as Windows PowerShell, business intelligence reporting engines, and Microsoft System Center
Operations Manager (SCOM).
Intended Audience
This document is intended for anyone who wants to customize or integrate software to work with View.
The information in this document is written for experienced Windows or Linux system administrators who
are familiar with virtual machine technology and datacenter operations.
VMware, Inc.
4
Introduction to View Integration1
With View, system administrators can provision desktops and control user access to these desktops.
Client software connects users to virtual machines running in VMware vSphere™, or to physical systems
running within your network environment. In addition, View administrators can configure Remote Desktop
Services (RDS) hosts to provide View desktop and application sessions to client devices.
This section includes the following topics:
n
View Components
n
Integration Interfaces to View
View Components
You can use View with VMware vCenter Server to create desktops from virtual machines that are running
on VMware ESX® or VMware ESXi™ hosts and deploy these desktops to end users. You can also install
View on RDS hosts to deploy desktops and applications to end users. View uses your existing Active
Directory infrastructure for user authentication and management.
After you create a desktop or application, authorized end users can use Web-based or locally installed
client software to securely connect to centralized virtual machines, back-end physical systems, or RDS
hosts.
View consists of the following major components.
View Connection
Server
Horizon AgentA software service that is installed on all guest virtual machines, physical
Horizon ClientA software application that communicates with View Connection Server to
VMware, Inc. 5
A software service that acts as a broker for client connections by
authenticating and then directing incoming user requests to the appropriate
virtual machine, physical system, or RDS host.
systems, or RDS hosts to allow them to be managed by View.
Horizon Agent provides features such as connection monitoring, virtual
printing, USB support, and single sign-on.
enable users to connect to their desktops.
View Integration
View AdministratorA Web application that enables View administrators to configure View
Connection Server, deploy desktop and application pools, manage
machines, control user authentication, initiate and examine system events,
and perform analytical activities.
Note View Administrator is named Horizon Administrator in Horizon 7.
vCenter ServerA server that acts as a central administrator for ESX/ESXi hosts that are
connected on a network. A vCenter Server instance provides the central
point for configuring, provisioning, and managing virtual machines in the
datacenter.
View ComposerA software service that is installed on a vCenter Server instance to enable
View to rapidly deploy multiple linked-clone desktops from a single
centralized base image.
Integration Interfaces to View
You can use several interfaces to integrate View with external applications.
Event databaseYou can configure View to record events to a Microsoft SQL Server or
Oracle database. You can then use business intelligence reporting engines
to access and analyze this database.
Lightweight Directory
Access Protocol
(LDAP)
Windows Management
Instrumentation (WMI)
You can export and import LDAP configuration data from and into View.
You can create scripts that update this configuration data without accessing
View Administrator directly.
You can examine performance statistics for a PCoIP session.
VMware, Inc. 6
Integrating View with the Event
Database2
You can configure View to record events to a Microsoft SQL Server or Oracle database. View records
events such as end-user actions, administrator actions, alerts that report system failures and errors, and
statistical sampling.
End-user actions include logging and starting desktop and application sessions. Administrator actions
include adding entitlements and creating desktop and application pools. An example of statistical
sampling is recording the maximum number of users over a 24-hour period.
You can use business intelligence reporting engines such as Crystal Reports, IBM Cognos, MicroStrategy
9, and Oracle Enterprise Performance Management System to access and analyze the event database.
This section includes the following topics:
n
Event Database Tables and Schemas
n
Connection Broker Events
n
Horizon Agent Events
n
View Administrator Events
n
Event Message Attributes
n
Sample Database Queries and Views
Event Database Tables and Schemas
View uses database tables to implement the event database. The event database prepends the names of
these tables with a prefix that you define when you set up the database.
Event Database Tables
The following table shows the database tables that implement the event database in View.
Table 2‑1. Event Database Tables
Table NameDescription
eventMetadata and search optimization data for recent events.
event_dataData values for recent events.
VMware, Inc. 7
View Integration
Table 2‑1. Event Database Tables (Continued)
Table NameDescription
event_data_historicalData values for all events.
event_historicalMetadata and search optimization data for all events.
View records details about events to all the database tables. After a certain period of time has elapsed
since writing an event record, View deletes the record from the event and event_data tables. You can use
View Administrator to configure the time period for which the database keeps a record in the event and
event_data tables.
Important View does not restrict the growth of the event_historical and event_data_historical tables.
You must implement a space management policy for these tables.
A unique primary key, EventID, identifies each event that View records in the event and event_historical
tables. View records data values for each event in the event_data and event_data_historical tables. You
can obtain the complete set of information for an event by joining the event and event_data tables or the
event_ historical and event_data_historical tables on the EventID column.
The EventType, Severity, and Time columns in the event and event_historical tables identify the type and
severity of an event and the time at which it occurred.
For information about setting up the event database, see the View Installation document.
Note Events might be lost if you restart View Connection Server instances while the event database is
not running. For a solution that avoids this problem see http://kb.vmware.com/kb/1021461.
Event Database Schemas
The following table shows the schema for the event and event_historical database tables.
Table 2‑2. Schema for the event and event_historical Tables
Column NameOracle Data TypeSQL Server Data TypeDescription
AcknowledgedSMALLINTtinyintWhether View acknowledged the event.
n
0 = false
n
1 = true
DesktopIdNVARCHAR2(512)nvarchar(512)Desktop ID of the associated pool.
EventIDINTEGERintUnique primary key for the event.
EventTypeNVARCHAR2(512)nvarchar(512)Event name that corresponds to an item in
the message catalog. For example,
BROKER_USERLOGGEDIN.
FolderPathNVARCHAR2(512)nvarchar(512)Full path of the folder that contains the
associated object.
GroupIdNVARCHAR2(512)nvarchar(512)SID of the associated group in Active
Directory.
VMware, Inc. 8
View Integration
Table 2‑2. Schema for the event and event_historical Tables (Continued)
Column NameOracle Data TypeSQL Server Data TypeDescription
LUNIdNVARCHAR2(512)nvarchar(512)ID of the LUN that stores the associated
object.
MachineIdNVARCHAR2(512)nvarchar(512)ID of the associated physical or virtual
machine.
ModuleNVARCHAR2(512)nvarchar(512)View component that raised the event. For
example, Admin, Broker, Tunnel,
Framework, Client, or Agent.
ModuleAndEventTextNVARCHAR2(512)nvarchar(512)Event message with values substituted for
attribute parameters.
NodeNVARCHAR2(512)nvarchar(512)Name of the virtual device node.
SeverityNVARCHAR2(512)nvarchar(512)Severity level. For example, INFO,
WARNING, ERROR, AUDIT_SUCCESS,
AUDIT_FAIL.
SourceNVARCHAR2(512)nvarchar(512)Identifier for the source of the event.
ThinAppIdNVARCHAR2(512)nvarchar(512)ID of the associated ThinApp™ object.
TimeTIMESTAMPdatetimeTime at which the event occurred,
measured from the epoch (January 1,
1970).
UserDiskPathIdNVARCHAR2(512)nvarchar(512)ID of the user disk.
UserSIDNVARCHAR2(512)nvarchar(512)SID of the associated user in Active
Directory.
The following table shows the schema for the event_data and event_data_historical database tables.
Table 2‑3. Schema for the event_data and event_data_historical Tables
Column NameOracle Data TypeSQL Server Data TypeDescription
BooleanValueSMALLINTtinyintValue of a Boolean attribute.
n
0 = false
n
1 = true
EventIDINTEGERintUnique primary key for the event.
IntValueINTEGERintValue of an integer attribute.
NameNVARCHAR2(512)nvarchar(512)Attribute name (for example,
UserDisplayName).
StrValueNVARCHAR2(512)nvarchar(512)Value of a string attribute. For other types
of attributes, this column contains an
interpretation of the data type as a string.
VMware, Inc. 9
View Integration
Table 2‑3. Schema for the event_data and event_data_historical Tables (Continued)
Column NameOracle Data TypeSQL Server Data TypeDescription
TimeValueTIMESTAMPdatetimeValue of a date and time attribute.
TypeSMALLINTtinyintThe data type of the attribute.
n
0 = StrValue
n
1 = IntValue
n
2 = TimeValue
n
3 = BooleanValue
Connection Broker Events
Connection broker events report View Connection Server-related information, such as desktop and
application sessions, user authentication failures, and provisioning errors.
The BROKER_DAILY_MAX_DESKTOP_SESSIONS event reports the maximum number of concurrent
desktop sessions over a 24-hour period. If a user runs multiple desktop sessions concurrently, each
desktop session is counted separately.
The BROKER_DAILY_MAX_APP_USERS event reports the maximum number of concurrent application
users over a 24-hour period. If a user runs multiple applications concurrently, the user is counted only
once. Short-lived sessions might not be included in the count because the sampling is performed every
five minutes.
The BROKER_VC_DISABLED and BROKER_VC_ENABLED events report the state of the vCenter
driver that View uses to track a vCenter Server instance.
The BROKER_VC_STATUS_* events report the state of a vCenter Server instance.
The following table lists all the event types for View Connection Server.
Table 2‑4. Connection Broker Events
Event TypeSeverityModuleAndEventText
BROKER_AGENT_OFFLINEWARNINGThe agent running on machine ${MachineName} has
not responded to queries, marking it as offline
BROKER_AGENT_ONLINEWARNINGThe agent running on machine ${MachineName} is
responding again, but did not send a startup message
BROKER_APPLICATION_LAUNCH_FAILUREERRORUnable to launch from Pool ${PoolId} for user $
{UserDisplayName}: The broker encountered an error
while processing the request, please contact support
for assistance
BROKER_APPLICATION_MISSINGWARNINGAt least ${ApplicationMissingCount} applications,
including ${ApplicationExecutable}, are not installed on
${MachineName} in Pool ${PoolId}
BROKER_APPLICATION_NOT_ENTITLEDAUDIT_FAILUnable to launch from Pool ${PoolId} for user $
{UserDisplayName}: User is not entitled to this Pool
VMware, Inc. 10
View Integration
Table 2‑4. Connection Broker Events (Continued)
Event TypeSeverityModuleAndEventText
BROKER_APPLICATION_PROTOCOL_NOT_S
UPPORTED
AUDIT_FAILUnable to launch from Pool ${PoolId} for user $
{UserDisplayName}: Requested protocol ${ProtocolId}
is not supported
AUDIT_FAILFailed to add security server ${SecurityServerId},
pairing password expired
AUDIT_FAILFailed to add security server ${SecurityServerId},
pairing password incorrect
AUDIT_FAILFailed to add security server ${SecurityServerId},
pairing password not set
BROKER_SECURITY_SERVER_ADDEDAUDIT_SUCCESSSecurity server ${SecurityServerId} added
BROKER_SVI_ARCHIVE_UDD_FAILEDAUDIT_FAILFailed to archive user data disk ${UserDiskName} to
location ${SVIPath}
BROKER_SVI_ARCHIVE_UDD_SUCCEEDEDAUDIT_SUCCESSArchived user data disk ${UserDiskName} to location $
{SVIPath}
BROKER_SVI_ATTACH_UDD_FAILEDAUDIT_FAILFailed to attach user data disk ${UserDiskName} to VM
${SVIVMID}
BROKER_SVI_ATTACH_UDD_SUCCEEDEDAUDIT_SUCCESSAttached user data disk ${UserDiskName} to VM $
{SVIVMID}
BROKER_SVI_DETACH_UDD_FAILEDAUDIT_FAILFailed to detach user data disk ${UserDiskName} from
VM ${SVIVMID}
BROKER_SVI_DETACH_UDD_SUCCEEDEDAUDIT_SUCCESSDetached user data disk ${UserDiskName} from VM $
{SVIVMID}
BROKER_USER_AUTHFAILED_ACCOUNT_
DISABLED
BROKER_USER_AUTHFAILED_ACCOUNT_
EXPIRED
BROKER_USER_AUTHFAILED_ACCOUNT_
LOCKED_OUT
BROKER_USER_AUTHFAILED_ACCOUNT_
RESTRICTION
AUDIT_FAILUser ${UserDisplayName} failed to authenticate
because the account is disabled
AUDIT_FAILUser ${UserDisplayName} failed to authenticate
because the account has expired
AUDIT_FAILUser ${UserDisplayName} failed to authenticate
because the account is locked out
AUDIT_FAILUser ${UserDisplayName} failed to authenticate
because of an account restriction
BROKER_USER_AUTHFAILED_BAD_USER_
PASSWORD
VMware, Inc. 14
AUDIT_FAILUser ${UserDisplayName} failed to authenticate
because of a bad username or password
View Integration
Table 2‑4. Connection Broker Events (Continued)
Event TypeSeverityModuleAndEventText
BROKER_USER_AUTHFAILED_GENERALAUDIT_FAILUser ${UserDisplayName} failed to authenticate
BROKER_USER_AUTHFAILED_NO_LOGON_
SERVERS
BROKER_USER_AUTHFAILED_PASSWORD_
EXPIRED
BROKER_USER_AUTHFAILED_PASSWORD_
MUST_CHANGE
BROKER_USER_AUTHFAILED_SECUREID_
AUDIT_FAILUser ${UserDisplayName} failed to authenticate
because there are no logon servers
AUDIT_FAILUser ${UserDisplayName} failed to authenticate
because the password has expired
AUDIT_FAILUser ${UserDisplayName} failed to authenticate
because the password must change
AUDIT_FAILSecurID access denied for user ${UserDisplayName}
ACCESS_DENIED
BROKER_USER_AUTHFAILED_SECUREID_
NEWPIN_REJECTED
BROKER_USER_AUTHFAILED_SECUREID_
WRONG_NEXTTOKEN
BROKER_USER_AUTHFAILED_SECUREID_
WRONG_STATE
BROKER_USER_AUTHFAILED_TIME_
RESTRICTION
AUDIT_FAILSecurID access denied for user ${UserDisplayName}
because new pin was rejected
AUDIT_FAILSecurID access denied for user ${UserDisplayName}
because wrong next token entered
AUDIT_FAILSecurID access denied for user ${UserDisplayName}
because of incorrect state
AUDIT_FAILUser ${UserDisplayName} failed to authenticate
because of a time restriction
BROKER_USER_NOT_AUTHORIZEDAUDIT_FAILUser ${UserDisplayName} has authenticated, but is not
authorized to perform the operation
BROKER_USER_NOT_ENTITLEDAUDIT_FAILUser ${UserDisplayName} has authenticated, but is not
entitled to any Pools
BROKER_USERCHANGEDPASSWORDAUDIT_SUCCESSPassword for ${UserDisplayName} has been changed
by the user
BROKER_USERLOGGEDINAUDIT_SUCCESSUser ${UserDisplayName} has logged in
BROKER_USERLOGGEDOUTAUDIT_SUCCESSUser ${UserDisplayName} has logged out
BROKER_VC_DISABLEDINFOvCenter at address ${VCAddress} has been temporarily
disabled
BROKER_VC_ENABLEDINFOvCenter at address ${VCAddress} has been enabled
BROKER_VC_STATUS_CHANGED_CANNOT_
WARNINGCannot log in to vCenter at address ${VCAddress}
LOGIN
BROKER_VC_STATUS_CHANGED_DOWNINFOvCenter at address ${VCAddress} is down
BROKER_VC_STATUS_CHANGED_INVALID_
CREDENTIALS
BROKER_VC_STATUS_CHANGED_NOT_YET
WARNINGvCenter at address ${VCAddress} has invalid
credentials
INFONot yet connected to vCenter at address ${VCAddress}
_ CONNECTED
BROKER_VC_STATUS_CHANGED_
INFOReconnecting to vCenter at address ${VCAddress}
RECONNECTING
BROKER_VC_STATUS_CHANGED_UNKNOWNWARNINGThe status of vCenter at address ${VCAddress} is
unknown
BROKER_VC_STATUS_CHANGED_UPINFOvCenter at address ${VCAddress} is up
VMware, Inc. 15
View Integration
Horizon Agent Events
View Agent events report Horizon Agent-related information, such as the users who have logged in to or
disconnected from a specific machine, whether Horizon Agent has shut down on a specific machine, and
whether Horizon Agent has sent a start up message from a specific machine to View Connection Server.
Table 2‑5. Horizon Agent Events
Event TypeSeverityModuleAndEventText
AGENT_CONNECTEDINFOUser ${UserDisplayName} has logged in to a new session on
machine ${MachineName}
AGENT_DISCONNECTEDINFOUser ${UserDisplayName} has disconnected from machine $
{MachineName}
AGENT_ENDEDINFOUser ${UserDisplayName} has logged off machine $
{MachineName}
AGENT_PENDINGINFOThe agent running on machine ${MachineName} has accepted an
allocated session for user ${UserDisplayName}
AGENT_PENDING_ EXPIREDWARNINGThe pending session on machine ${MachineName} for user $
{UserDisplayName} has expired
AGENT_RECONFIGUREDINFOMachine ${MachineName} has been successfully reconfigured
AGENT_RECONNECTEDINFOUser ${UserDisplayName} has reconnected to machine $
{MachineName}
AGENT_RESUMEINFOThe agent on machine ${MachineName} sent a resume message
AGENT_SHUTDOWNINFOThe agent running on machine ${MachineName} has shut down,
this machine will be unavailable
AGENT_STARTUPINFOThe agent running on machine ${MachineName} has contacted
the connection server and sent a startup message
AGENT_SUSPENDINFOThe agent on machine ${MachineName} sent a suspend message
View Administrator Events
View Administrator events report information about actions that users initiate in View Administrator.
Table 2‑6. View Administrator Events
EventTypeSeverityModuleAndEventText
ADMIN_ADD_DESKTOP_ENTITLEMENTAUDIT_SUCCESS${EntitlementDisplay} was entitled to Pool
ADMIN_VC_LICINV_ALARM_DISABLEDAUDIT_SUCCESSAlarm on VC server ${VCAddress} for
License Inventory monitoring was
disabled as all Hosts have desktop
licenses
VMware, Inc. 24
View Integration
Table 2‑6. View Administrator Events (Continued)
EventTypeSeverityModuleAndEventText
ADMIN_VC_REMOVE_FAILEDAUDIT_FAIL${UserDisplayName} failed to remove VC
server ${VCAddress}
ADMIN_VC_REMOVEDAUDIT_SUCCESS${UserDisplayName} removed VC server
${VCAddress}
Event Message Attributes
ModuleAndEventText messages use certain attributes. To determine the data type for an attribute, you
can examine its value in the type column in the event_data or event_data_historical table.
Table 2‑7. Attributes that ModuleAndEventText Messages Use
Attribute NameDescription
AdminFolderNameName of a folder that requries privileged access.
AdminPermissionEntityName of an object that requires privileged access.
AdminPrivilegeNameName of an administrative privilege.
AdminRoleNameName of an administrative role.
AdminRoleNewNameNew name of an administrative role.
AttrChangeTypeType of change that was applied to a generic attribute.
AttrNameName of a generic attribute.
AttrValueValue of a generic attribute.
BrokerIdIdentifier of a View Connection Server instance.
BrokerNameName of a View Connection Server instance.
DesktopDisplayNameDisplay name of a desktop pool.
DesktopIdIdentifier of a desktop pool.
EntitlementDisplayDisplay name of a desktop entitlement.
MachineIdName of a physical or virtual machine.
MachineNameName of a physical or virtual machine.
MaintenanceModeMaintenance mode state.
ObjectIDIdentifier of an inventory object.
ObjectTypeType of an inventory object.
PolicyDisplayNameDisplay name of a policy.
PolicyObjectIdentifier of a policy object.
PolicyValueValue of a policy object.
ProtocolIdIdentifier of a display protocol.
SecurityServerIdIdentifier of a security server.
SVIAdminFqdnFQDN of a QuickPrep domain.
VMware, Inc. 25
View Integration
Table 2‑7. Attributes that ModuleAndEventText Messages Use (Continued)
Attribute NameDescription
SVIAdminIDIdentifier of a QuickPrep domain.
SVIAdminNameName of a QuickPrep domain.
SVIDeploymentGroupIDIdentifier of a View Composer deployment group.
SVIOperationName of a View Composer operation.
SVIParentVMParent virtual machine in View Composer.
SVIPathPath of an object in View Composer.
SVISnapshotSnapshot in View Composer.
SVIVMIDIdentifier of a virtual machine in View Composer.
ThinAppDisplayNameDisplay name of a ThinApp object.
ThinAppIdIdentifier of a ThinApp object.
ThinAppRepositoryNameName of a ThinApp repository
ThinAppRepositoryPathPath of a ThinApp repository.
TimeDate and time value.
UserCountMaximum number of desktop users over a 24-hour period.
UserDiskNameName of a user data disk.
UserDisplayNameUser name in the form DOMAIN\username.
UserNameName of a user in Active Directory.
VCAddressURL of a vCenter Server.
Sample Database Queries and Views
You can query the event_historical database to display error events, warning events, and specific recent
events.
Note Replace the dbo.VE_ prefix in the following examples with the appropriate prefix for your event
database.
List Error Events
The following query displays all error events from the event_historical table.
WHERE ev.EventID = ed1.EventID AND ev.EventID = ed2.EventID AND ev.EventID = ed3.EventID
AND
ev.EventType = ‘ADMIN_THINAPP_REPO_ADDED’ AND
ed1.Name = ‘UserDisplayName’ AND ed2.Name = ‘ThinAppRepositoryName’ AND
ed3.Name = ‘ThinAppRepositoryPath’
);
VMware, Inc. 28
Customizing LDAP Data3
You can use VMware and Microsoft command-line tools to import and export LDAP configuration data to
and from View. These command-line tools import and export LDAP configuration data in LDAP Data
Interchange Format (LDIF) configuration files.
This feature is intended for use by advanced administrators who want to perform automatic bulk
configuration operations. To create scripts to update the View configuration, use View PowerCLI.
This section includes the following topics:
n
Introduction to LDAP Configuration Data
n
Modifying LDAP Configuration Data
Introduction to LDAP Configuration Data
All View configuration data is stored in an LDAP directory. Each View Connection Server standard or
replica instance contains a local LDAP configuration repository and a replication agreement between
each of the View Connection Server instances. This arrangement ensures that changes to one repository
are automatically replicated to all other repositories.
When you use View Administrator to modify the View configuration, the appropriate LDAP data is updated
in the repository. For example, if you add a desktop pool, View stores information about users, user
groups, and entitlements in LDAP. View Connection Server instances manage other LDAP configuration
data automatically, and they use the information in the repository to control View operations.
You can use LDIF configuration files to perform a number of tasks, including transferring configuration
data between View Connection Server instances and backing up your View configuration so that you can
restore the state of a View Connection Server instance.
You can also use LDIF configuration files to define a large number of View objects, such as desktop
pools, and add those objects to your View Connection Server instances without having to use View
Administrator to perform the task manually.
In View 3.1 and later releases, View performs regular backups of the LDAP repository.
LDAP configuration data is transferred as plain ASCII text and conforms to the Internet Engineering Task
Force (IETF) RFC 2849 standard.
VMware, Inc.
29
View Integration
Modifying LDAP Configuration Data
You can export LDAP configuration data on a View Connection Server instance to an LDIF configuration
file, modify the LDIF configuration file, and import the modified LDIF configuration file into other View
Connection Server instances to perform automatic bulk configuration operations.
You can obtain examples of LDIF syntax for any item of LDAP configuration data in View by examining
the contents of an exported LDIF configuration file. For example, you can extract the data for a desktop
pool and use that data as a template to create a large number of desktop pools.
Export LDAP Configuration Data
You can use the vdmexport command-line utility to export configuration data from a standard or replica
View Connection Server instance to an LDIF configuration file.
By default, the vdmexport command-line utility is installed in the C:\Program Files\VMware\VMwareView\Server\tools\bin directory.
Procedure
1Log in to a standard or replica View Connection server instance.
OptionAction
View 3.1 and earlierLog in as an administrator and be a member of the Local Administrators user
group.
View 4.5 and laterLog in as a user in the Administrators or Administrators (Read only) role.
Note You must be logged in as a user in the Administrators or Administrators
(Read only) role to export configuration data from the View configuration
repository.
2At the command prompt, type the vdmexport command and use the -f option to specify the name of
the LDIF configuration file to export.
For example: vdmexport -f myexport.LDF
Alternatively, you can redirect the output instead of using the -f option.
For example: vdmexport > myexport.LDF
The vdmexport command writes the configuration of your View Connection Server instance to the file
that you specify. The command displays errors if your role has insufficient privileges to view the data in
the configuration repository.
VMware, Inc. 30
View Integration
Defining a Desktop Pool in an LDIF Configuration File
You can define a desktop pool in an LDIF configuration file and import the customized LDIF configuration
file to create a large number of desktop pools.
Note You can also create customized LDIF configuration files for other objects that are defined in the
LDAP repository, including global configuration settings, configuration settings for a specific View
Connection Server instance or security server, and configuration settings for a specific user.
To define a desktop pool in an LDIF configuration file, you must add the following entries to the file.
n
A Virtual Desktop VM entry for each virtual desktop in the desktop pool
n
A VM Pool entry for each desktop pool
n
A Desktop Application entry that defines the entitlement of the desktop pool
You associate each VM Pool entry with one Desktop Application entry in a one-to-one relationship. A
Desktop Application entry cannot be shared between VM Pool entries, and a VM Pool entry can only be
associated with one Desktop Application entry.
The following table describes the attributes you must specify when you modify a desktop pool definition in
an LDIF configuration file.
Table 3‑1. Important Attributes for Defining a Desktop Pool
EntryAttributeDescription
Virtual Desktop VM
VM Pool
Desktop Application
Desktop ApplicationmemberA list of Active Directory (AD) users and groups who are entitled to access
cnCommon name of an entry. If you require names to be generated
automatically, specify globally unique identifier (GUID) strings. You can use
any reliable GUID generator, such as the mechanism provided by .NET (for
example, by calling System.Guid.NewGuid().ToString() in Visual Basic).
the desktop pool. The attribute is specified in the form of a Windows Security
Identifier (SID) reference. A member value of <SID=S-1-2-3-4> represents an
AD user or group with the SID value S-1-2-3-4.
In LDIF format, the left angle (<) character is reserved, so you must place
two colons (::) after the attribute name and specify the SID value in base 64
format (for example, PFNJRD1TLTEtMi0zLTQ+IA==). Because this attribute
is multivalued, you can use it on multiple lines to represent each entry in a list
of SIDs.
Sample LDIF Configuration File Desktop Pool Entries
The following example is an excerpt from an LDIF configuration file. It shows sample entries for a desktop
pool named Pool1, which contains two virtual desktops named VM1 and VM2. The desktop pool entry is
paired with the Desktop Application entry, which is also named Pool1.
#
# Virtual Desktop VM entry VM1
#
DN: CN=vm1,OU=Servers,DC=vdi,DC=vmware,DC=int
VMware, Inc. 31
View Integration
changetype: add
objectClass: top
objectClass: pae-Server
objectClass: pae-WinServer
objectClass: pae-ThinWinServer
objectClass: pae-VM
cn: vm1
description: sample virtual desktop entry
pae-VmSuspended:: IA==
pae-OptIgnoreProcessList: 0
pae-MOID: vm-1
pae-VmState: READY
pae-ServerManaged: 1
pae-SSOEnabled: 1
pae-DisplayName: virtual desktop 1
pae-TunneledConnection: 1
pae-pwdEncryption: KERB5
ipHostNumber: vm1
pae-ClientProtVersion: 1
pae-WinDomain: NULL
pae-thinProto: XP_RDP
pae-Services: SESSION |, HEARTBEAT |, EVENTS |, USED |
pae-VmPath: /New Datacenter/vm/vm-1
pae-OptSuspendTimeout: 0
pae-OptDisconnectLimitTimeout: 0
pae-OptMaximumSessions: 0
pae-Disabled: 0
#
# Virtual Desktop VM entry VM2
#
DN: CN=vm2,OU=Servers,DC=vdi,DC=vmware,DC=int
changetype: add
objectClass: top
objectClass: pae-Server
objectClass: pae-WinServer
objectClass: pae-ThinWinServer
objectClass: pae-VM
cn: vm2
description: sample virtual desktop entry
pae-VmSuspended:: IA==
pae-OptIgnoreProcessList: 0
pae-MOID: vm-2
pae-VmState: READY
pae-ServerManaged: 1
pae-SSOEnabled: 1
pae-DisplayName: virtual desktop 2
pae-TunneledConnection: 1
pae-pwdEncryption: KERB5
ipHostNumber: vm2
pae-ClientProtVersion: 1
pae-WinDomain: NULL
pae-thinProto: XP_RDP
pae-Services: SESSION |, HEARTBEAT |, EVENTS |, USED |
Use the vdmimport Command to Import LDAP Configuration Data
In View 4.5 and later releases, you can use the vdmimport command to import configuration data from an
LDIF configuration file into a standard or replica View Connection Server instance.
By default, the vdmimport command-line utility is installed in the C:\Program Files\VMware\VMwareView\Server\tools\bin directory.
Prerequisites
n
Verify that you have View 4.5 or later. If you have an earlier View release, see Use the LDIFDE
Command to Import LDAP Configuration Data.
n
Export LDAP configuration data to an LDIF configuration file. See Export LDAP Configuration Data.
Procedure
1Log in to a View Connection Server instance as a user in the Administrators role.
You must be logged in as a user in the Administrators role to import configuration data into the View
configuration repository.
2At the command prompt, type the vdmimport command and use the -f option to specify the LDIF
configuration file to import.
For example: vdmimport -f myexport.LDF
After the vdmimport command runs, the configuration of your View Connection Server instance is
updated with the data from the file, and the number of records that have been successfully updated is
displayed. Errors are displayed if some records could not be updated because your role has insufficient
privileges.
Use the LDIFDE Command to Import LDAP Configuration Data
You can use the Microsoft LDIFDE command to import configuration data from an LDIF configuration file
into a standard or replica View Connection Server instance.
In View releases earlier than View 4.5, you must use the Microsoft LDIFDE command to import
configuration data from an LDIF configuration file. The vdmimport command is not supported in View
releases earlier than View 4.5.
If you have View 4.5 or later, use the vdmimport command rather than the LDIFDE command. The
vdmimport command does not display the large number of error messages that are produced by running
the LDIFDE command. For more information, see Use the vdmimport Command to Import LDAP
Configuration Data.
Because the LDIFDE command does not update, create, or delete any LDAP records that are not defined
in the LDIF configuration file, it enables you to customize an LDIF configuration file so that only selected
records are affected when you import the file. For complete information about using the LDIFDE
command, go to http://support.microsoft.com/kb/237677.
VMware, Inc. 34
View Integration
Prerequisites
Export LDAP configuration data to an LDIF configuration file. See Export LDAP Configuration Data.
Procedure
1Log in to a View Connection server instance.
OptionAction
View 3.1 or earlierLog in as an administrator and be a member of the Local Administrators user
group.
View 4.5 or laterLog in as a user in the Administrators role.
Note You must be logged in as a user in the Administrators role to import
configuration data into the View configuration repository.
2At the command prompt, type the LDIFDE command and use the -f option to specify an existing LDIF
configuration file.
For example: LDIFDE -i -f myexport.LDF -s 127.0.0.1 -z
After the LDIFDE command runs, the configuration of your View Connection Server instance is updated
with the data from the file, and the number of records that are successfully updated is displayed.
Error messages appear whenever an existing entry in the repository is overwritten. You can ignore these
error messages. Error messages also appear if a record cannot be updated because your role has
insufficient privileges.
VMware, Inc. 35
Examining PCoIP Session
Statistics with WMI4
You can use Windows Management Instrumentation (WMI) to examine performance statistics for a PCoIP
session by using any of the supported programming interfaces, including C#, C++, PowerShell, VBScript,
VB .NET, and Windows Management Instrumentation Command-line (WMIC).
You can also use the Microsoft WMI Code Creator tool to generate VBScript, C#, and VB .NET code that
accesses the PCoIP performance counters. For more information about WMI, WMIC, and the WMI Code
Creator tool, go to http://technet.microsoft.com/en-us/library/bb742610.aspx and
Examples of Using PowerShell cmdlets to Examine PCoIP Statistics
Using PCoIP Session Statistics
The WMI namespace for the PCoIP session statistics is root\CIMV2. The names of the statistics are
suffixed with (Server) or (Client), according to whether the statistic is recorded on the PCoIP server
or PCoIP client.
You can use Windows Performance Monitor (PerfMon) with the counters to calculate averages over a
specified sampling period. You must have administrator privileges to access the performance counters
remotely.
All statistics are reset to 0 when a PCoIP session is closed. If the WMI SessionDurationSeconds
property is a non-zero value and stays constant, the PCoIP server was forcefully ended or crashed. If the
SessionDurationSeconds property changes from a non-zero value to 0, the PCoIP session is closed.
VMware, Inc.
36
View Integration
To avoid a division-by-zero error, verify that the denominator in the expressions for calculating bandwidth
or packet-loss percentage does not evaluate to zero.
USB statistics are recorded for zero clients, but not for thin clients or software clients.
General PCoIP Session Statistics
The WMI class name for PCoIP general session statistics is
Win32_PerfRawData_TeradiciPerf_PCoIPSessionGeneralStatistics.
Table 4‑1. General Session Statistics
WMI Property NameDescription
BytesReceived
BytesSent
PacketsReceived
PacketsSent
RXPacketsLost
SessionDurationSeconds
TXPacketsLost
Total number of bytes of PCoIP data that have been received since the PCoIP
session started.
Total number of bytes of PCoIP data that have been transmitted since the PCoIP
session started.
Total number of packets that have been received successfully since the PCoIP
session started. Not all packets are the same size.
Total number of packets that have been transmitted since the PCoIP session started.
Not all packets are the same size.
Total number of received packets that have been lost since the PCoIP session
started.
Total number of seconds that the PCoIP Session has been open.
Total number of transmitted packets that have been lost since the PCoIP session
started.
Calculating Bandwith for Received PCoIP Data
To calculate the bandwidth in kilobits per second for received PCoIP data over the time interval from time
To calculate the bandwidth in kilobits per second for transmitted PCoIP data over the time interval from
time t1 to time t2, use the following formula.
Do not use AudioRXBWkbitPersec for this calculation.
Calculating Bandwidth for Transmitted Audio Data
To calculate the bandwidth in kilobits per second for transmitted audio data over the time interval from
time t1 to time t2, use the following formula.
Do not use AudioTXBWkbitPersec for this calculation.
VMware, Inc. 38
View Integration
PCoIP Imaging Statistics
The WMI class name for PCoIP imaging statistics is
Win32_PerfRawData_TeradiciPerf_PCoIPSessionImagingStatistics.
Table 4‑3. PCoIP Imaging Statistics
WMI Property NameDescription
ImagingBytesReceived
ImagingBytesSent
ImagingDecoderCapabilitykbitPersec
ImagingEncodedFramesPersec
ImagingActiveMinimumQuality
ImagingRXBWkbitPersec
ImagingTXBWkbitPersec
Total number of bytes of imaging data that have been received
since the PCoIP session started.
Total number of bytes of imaging data that have been
transmitted since the PCoIP session started.
Estimated processing capability of the imaging decoder in
kilobits per second. This statistic is updated once per second.
Number of imaging frames that were encoded over a onesecond sampling period.
Lowest encoded quality value on a scale from 0 to 100. This
statistic is updated once per second. This counter does not
correspond to the GPO setting for minimum quality.
Bandwidth for incoming imaging packets averaged over the
sampling period, in seconds.
Bandwidth for outgoing imaging packets averaged over the
sampling period, in seconds.
Calculating Bandwidth for Received Imaging Data
To calculate the bandwidth in kilobits per second for received imaging data over the time interval from
time t1 to time t2, use the following formula.
Do not use ImagingRXBWkbitPersec for the calculation.
Calculating Bandwidth for Transmitted Imaging Data
To calculate the bandwidth in kilobits per second for transmitted imaging data over the time interval from
time t1 to time t2, use the following formula.
To calculate the packet loss in percentage for received data over the time interval from time t1 to time t2,
use the following formula.
PacketsReceived during interval = (PacketsReceived[t2]-PacketsReceived[t1])
RXPacketsLost during interval = (RXPacketsLost[t2]-RXPacketsLost[t1])
RXPacketsLost % = RXPacketsLost during interval /
(RXPacketsLost during interval + PacketsReceived during interval) * 100
Do not use RXPacketLostPercent or RXPacketLostPercent_Base for the calculation.
Calculating Packet Loss for Transmitted Network Data
To calculate the packet loss in percentage for transmitted data over the time interval from time t1 to time
t2, use the following formula.
PacketsSent during interval = (PacketsSent[t2]-PacketsSent[t1])
TXPacketsLost during interval = (TXPacketsLost[t2]-TXPacketsLost[t1])
TXPacketsLost % = TXPacketsLost during interval /
(TXPacketsLost during interval + PacketsSent during interval) * 100
Do not use TXPacketLostPercent or TXPacketLostPercent_Base for the calculation.
Use this formula to prevent the packet loss percent from becoming greater than 100 percent. This
calculation is required because PacketsLost and PacketsSent are asynchronous.
PCoIP USB Statistics
The WMI class name for PCoIP USB statistics is
Win32_PerfRawData_TeradiciPerf_PCoIPSessionUSBStatistics.
Table 4‑5. PCoIP USB Statistics
WMI Property NameDescription
USBBytesReceived
USBBytesSent
Total number of bytes of USB data that have been received since the PCoIP
session started.
Total number of bytes of USB data that have been transmitted since the PCoIP
session started.
USBRXBWkbitPersec
USBTXBWkbitPersec
VMware, Inc. 41
Bandwidth for incoming USB packets averaged over the sampling period, in
seconds.
Bandwidth for outgoing USB packets averaged over the sampling period, in
seconds.
View Integration
Calculating Bandwidth for Received USB Data
To calculate the bandwidth in kilobits per second for received USB data over the time interval from time
In the following example, the Get-WmiObject cmdlet retrieves the PCoIP general session statistics for
desktop dt-03 if any transmitted packets have been lost.
Get-WmiObject -namespace "root\cimv2" -computername desktop-03 -query "select * from
Win32_PerfRawData_TeradiciPerf_PCoIPSessionGeneralStatistics where TXPacketsLost > 0"
VMware, Inc. 42
Setting Desktop Policies with
Start Session Scripts5
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 section includes the following topics:
n
Obtaining Input Data for a Start Session Script
n
Best Practices for Using Start Session Scripts
n
Preparing a View Desktop to Use a Start Session Script
n
Sample Start Session Scripts
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 Configuring 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 configure desktop policies before a session starts.
VMware, Inc.
43
View Integration
As a best practice, use the Horizon 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 Configuring Remote DesktopFeatures in Horizon 7 document.
Managing Start Session Timeouts
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 Horizon Agent can respond to the StartSession message that View Connection
Server sends. A long-running script is likely to cause the StartSession request to time out.
If a timeout occurs and the pool uses floating assignments, View Connection Server tries to connect the
user to another virtual machine. If a timeout occurs and no virtual machine is available, View Connection
Server rejects the user's connection request.
As a best practice, set a hard timeout for the script host operation so that a specific error can be returned
if a script runs too long.
Making Start Session Scripts Accessible
The path where you configure your start session scripts must be 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 start session scripts in the View_Agent_install_path\scripts directory, for
example:
By default, this directory is accessible only by the SYSTEM and administrator accounts.
Preparing a View Desktop to Use a Start Session Script
To prepare a View desktop to use a start session script, you must enable the VMware View Script Host
service and add entries in the Windows registry.
You must configure all View desktops that need to run start session scripts. View does not provide a
mechanism to propagate registry changes, VMware View Script Host service configuration changes, and
start session scripts to multiple View desktop virtual machines.
VMware, Inc. 44
View Integration
Enable the VMware View Script Host Service
You must enable the VMware View Script Host service on each View desktop virtual machine where you
want View to run a start session script. The VMware View Script Host service is disabled by default.
When you configure the VMware View Script Host service, you can optionally specify the user account
under which the start session script runs. Start session scripts run in the context of the VMware View
Script Host service. By default, the VMware View Host Script service is configured to run as the SYSTEM
user.
Important 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.
Procedure
1Log in to the View desktop virtual machine.
2At the command prompt, type services.msc to start the Windows Services tool.
3In the details pane, right-click the VMware View Script Host service entry and select Properties.
4On the General tab, select Automatic from the Startup type drop-down menu.
5(Optional) If you do not want the local System account to run the start session script, select the Log
On tab, select This account, and type the user name and password of the account to run the start
session script.
6Click OK and exit the Windows Services tool.
Add Windows Registry Entries for a Start Session Script
You must add Windows registry entries on each View desktop virtual machine where you want View to
run a start session script.
Prerequisites
n
Verify that the path where you configured your start session scripts is accessible only to the SYSTEM
account and local administrators. For more information, see Making Start Session Scripts Accessible.
n
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 Horizon Agent can
respond to the StartSession message that View Connection Server sends. For more information, see
Managing Start Session Timeouts.
Procedure
1Log in to the View desktop virtual machine.
2At the command prompt, type regedit to start the Windows Registry Editor.
3In the registry, navigate to HKLM\SOFTWARE\VMware, Inc.\VMware VDM\ScriptEvents.
VMware, Inc. 45
View Integration
4Add the path to the start session script to the registry.
aIn the navigation area, right-click ScriptEvents, select New > Key, and create a key named
StartSession.
bIn the navigation area, right-click StartSession, select New > String Value, and create a string
value that identifies the start session script to 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 particular order, invoke them from a single control script.
cIn the topic area, right-click the entry for the new string value and select Modify.
dIn the Value data text box, type the command line that invokes the start session script and click
OK.
Type the full path of the start session script and any files that it requires.
5Add and enable a start session value in the registry.
aNavigate to HKLM\SOFTWARE\VMware, Inc.\VMware VDM\Agent\Configuration.
b(Optional) If the Configuration key does not exist, right-click Agent, select New > Key, and
create the key.
cIn the navigation area, right-click Configuration, select New > DWORD (32 bit) Value, and
type RunScriptsOnStartSession.
dIn the topic area, right-click the entry for the new DWORD value and select Modify.
eIn the Value data text box, type 1 to enable start session scripting and click OK.
You can type 0 to disable this feature. The default value is 0.
f(Optional) To delay the StartSession response by Horizon Agent, add a second DWORD value to
the Configuration key called WaitScriptsOnStartSession.
A WaitScriptsOnStartSession data value of 1 causes Horizon Agent to delay sending a
StartSession response and fail if the scripts do not complete. A value of 0 means that
Horizon Agent does not wait for the scripts to complete or check script exit codes before sending
the StartSession response. The default value is 0.
6Set a registry value to specify timeout values in seconds rather than minutes to prevent scripts from
timing out.
Setting this timeout value in seconds enables you to configure the VMware View Script Host service
timeout value in seconds. For example, if you set the VMware View Script Host service timeout to 30
seconds, you can ensure that a start session script either finishes running or times out before a View
Connection Server timeout occurs.
aNavigate to HKLM\SOFTWARE\VMware, Inc.\VMware VDM\ScriptEvents.
bAdd a DWORD value called TimeoutsInMinutes.
cSet a data value of 0.
VMware, Inc. 46
View Integration
7(Optional) To enable the VMware View Script Host service to time out the start session script, set a
timeout value.
aNavigate to HKLM\SOFTWARE\VMware, Inc.\VMware VDM\ScriptEvents\StartSession.
bIn the topic area, right-click the Default (@) key and select Modify.
cIn the Value data text box, type the timeout value and click OK.
A value of 0 means that no timeout is set.
8Exit the Registry Editor and restart the system.
Sample Start Session Scripts
These sample start session scripts illustrate how to write environment variables to a file, test the timeout
functionality, and test a non-zero exit code.
The following sample Visual Basic script writes all the environment variables provided to the script into a
file. You can use this sample script to see example data in your own environment. You might save this
script as C:\sample.vbs.
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
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
VMware, Inc. 47
Loading...
+ hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.