4.6

Table Of Contents
VMware View Integration
44 VMware, Inc.
Setthesessiontimeoutto30minutes.
Update-GlobalSetting -SessionTimeout 30
Settheforcedlogoutwarningmessageanddelayperiod.
Update-GlobalSetting -DisplayLogoffWarning $true -ForcedLogoffAfter $logoutdelay
-ForcedLogoffMessage "Forced log out will occur in $logoutdelay minutes"
RequireclientstouseSSLtoconnectandsetthepreloginmessage.
Update-GlobalSetting -UseSSLClient $true -PreLoginMessage "Insert disclaimer and other notices
here."
Managing View Licenses
DisplaytheinstalledViewlicensekeys.
Get-License
Addalicensekey.
Set-License -key "08A25-0212B-0212C-4D42E"
Examples of Using View PowerCLI for Enhanced Functionality
YoucancreatePowerShellfunctionsbycombiningViewPowerCLIandvSpherePowerCLIcmdletstoperform
complexoperationssuchasresizingpools,andaddingdatastorestodesktoppools.Thefollowingsections
containsamplefunctionsthatyoucanadaptandapplytoyourownsystems.
Checking if a View Connection Server Instance Is Running
DefineaPowerShellfunctiontocheckifaViewConnectionServerinstanceisrunning,andoptionally,start
theservice.
# WaitForViewStartup
# Parameters
# $ClearError If $true, clear the $error object on completion.
# $StartBroker If $true, start the service if it is not running.
function WaitForViewStartup
{ param ($ClearError = $true, $StartBroker = $true)
$service = Get-Service wsbroker
if($service -and (Get-Service wstomcat)){
$started = $false
if($service.Status -eq "Stopped"){
if($StartBroker){ # Start the broker if it is not running.
Write-Warning "Connection Broker service is stopped, attempting to start."
$errCountBefore = $error.Count
Start-Service wsbroker
$errCountAfter = $error.Count
if($errorCountAfter -gt $errorCountBefore){
break
}
} else {
Write-Error "Connection Broker service is stopped."
break
}
}
while(!$started){ # Loop until service has completed starting up.
Write-Warning "Waiting for View Connection Server to start."
$errCountBefore = $error.Count
$output = Get-GlobalSetting -ErrorAction SilentlyContinue
$errCountAfter = $error.Count
$started = $true
if($errCountAfter -gt $errCountBefore){
$err = $error[0].ToString()
if($err.Contains("NoQueueHandler")){