6.2
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
- 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
VMware, Inc. 47
Chapter 3 Using View PowerCLI
$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
}
# Determine the maximum number of desktops configured for a pool.
$maxdesktops = 0
if($Pool.deliveryModel -eq "Provisioned"){
$maxdesktops = $Pool.maximumCount
} else {
$maxdesktops = $Pool.machineDNs.split(";").Count
}
# Output the usage statistics for a pool.
Write-Output ("==== " + $Pool.pool_id + " ====")
Write-Output ("Remote session count: " + $remotecount)
Write-Output ("Maximum desktops: " + $maxdesktops)