Thursday, May 15, 2014

VMware PowerCLI - Change Pool AutoLogoff Behavior


VMware PowerCLI for View it's a very handful tool if we need to administer a big number of VMware Horizon View pools.
Very similar/based on Microsoft Powershell, VMware PowerCLI allows to run commands directly to VMware View and running scripts also.

Here's a nice one to change a pool's behavior for AutoLogoff after a user's disconnect from a machine.
The script reads a text file that only have the PoolID for all pools that you want to change:

#*********************************************************************
# Application: Change Pool AutoLogoff Timeout From List
#
# Overview: Changes the pool autologoff timeout from a given list
#
#*********************************************************************

$sourcevms = "C:\Pools.txt"
$list = Get-Content $sourcevms

foreach($item in $list){
 Get-Pool -Pool_id $item | Update-AutomaticLinkedClonePool -AutologoffTime 30
}