5.2
Table Of Contents
- VMware Horizon 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 Terminal Servers
- Obtaining Information About Users and Groups from Active Directory
- Managing Desktop Entitlements
- Managing Local Desktops
- 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
VMware Horizon View Integration
48 VMware, Inc.
$errCountAfter = $error.Count
$started = $true
if($errCountAfter -gt $errCountBefore){
$err = $error[0].ToString()
if($err.Contains("NoQueueHandler")){
$started = $false
Start-Sleep -s 1
} else {
if($ClearError){
$error.Clear()
}
Write-Error $err
break
}
}
if($ClearError){
$error.Clear()
}
}
} else {
Write-Error "The View Connection Server services could not be found. Is the Connection
Server installed?"
}
}
Resize Automatic and Linked-Clone Desktop Pools
Define PowerShell functions to check the current usage of all desktop pools, and to resize any automatically
provisioned or linked-clone desktop pools that are at their maximum capacity.
# PollAllPoolsUsage
# Parameters
# $increment Amount by which to increase a pool that is at maximum capacity (default = 5).
function PollAllPoolsUsage
{ param ($increment)
if(-not $increment){
$increment = 5
}
# Retrieve all pool objects and check each one individually
$pools = Get-Pool
foreach ($pool in $pools){
PollPoolUsage $pool $increment
}
}
# PollPoolUsage
# Parameters
# $Pool Pool object that represents the pool to be checked.
# $increment Amount by which to increase pool that is at maximum capacity.
function PollPoolUsage
{ param ($Pool, $increment)
# Get a list of remote sessions for the pool (errors are suppressed)
$remotes = Get-RemoteSession -pool_id $Pool.pool_id -ErrorAction SilentlyContinue
# Count the remote sessions.
$remotecount = 0
if($remotes){
$remotecount = ([Object[]]($remotes)).Count
}
# Get a list of local sessions for the pool (errors are suppressed)
$locals = Get-LocalSession -pool_id $Pool.pool_id -ErrorAction SilentlyContinue
# Count the local sessions.
$localcount = 0
if($locals){