Integration

Table Of Contents
Table 318. Examples of Rebalance, Refresh and Recompose Operations
Task Example View PowerCLI cmdlet Syntax
Rebalance desktops among the available
datastores in a linked-clone desktop pool
Get-DesktopVM -pool_id lcdpool_2 | Send-
LinkedCloneRebalance -schedule 2011-05-10:01:00:00 -
forceLogoff $false -stopOnError $true
Refresh the operating system disk in each
linked-clone desktop by restoring its original
state and size
Get-DesktopVM -pool_id lcdpool_2 | Send-LinkedCloneRefresh
-schedule "May 12 2011 01:15" -forceLogoff $true -
stopOnError $true
Recompose all linked-clone desktops from a
snapshot of the parent virtual machine
Get-DesktopVM -pool_id lcdpool_2 | Send-
LinkedCloneRecompose -schedule ((Get-Date).AddHours(8)) -
parentVMPath /AutoPoolVMs/parent2 -
parentSnapshotPath /AutoPoolSnapshots/parent2_snapshot -
forceLogoff $true -stopOnError $true
Creating and Updating Manually Provisioned Desktop Pools
You can use the Add-ManualPool, Get-ViewVC, and Update-ManualPool cmdlets to create and update manually
provisioned desktop pools.
In the following example, the Add-ManualPool cmdlet creates a manually provisioned desktop pool named
manPool that contains a virtual machine named myVM.
Add-ManualPool -pool_id manPool -id (Get-VM -name "myVM").id -isUserResetAllowed $true
In the following example, the Get-ViewVC cmdlet creates a manually provisioned desktop pool named man1
from the desktops managed by the vCenter Server instance named vc.mydom.int.
Get-ViewVC -serverName vc.mydom.int | Get-DesktopVM -poolType Manual | Add-ManualPool -pool_id
man1 -isUserResetAllowed $false
In the following example, the Update-ManualPool cmdlet updates the configuration of a manually
provisioned desktop pool named man1.
Update-ManualPool -pool_id man1 -displayName "Manual Desktop 1" -isUserResetAllowed $true
NOTE To use the Get-VM cmdlet, you must install vSphere PowerCLI.
Creating and Updating Manual Unmanaged Desktop Pools
You can use the Add-ManualUnmanagedPool and Update-ManualUnmanagedPool cmdlets to create and update
manual unmanaged desktop pools.
In the following example, the Add-ManualUnmanagedPool cmdlet creates an unmanaged desktop pool named
unman1 that contains physical machines named pm01 and pm02.
Add-ManualUnmanagedPool -pool_id unman1 -pm_id_list pm01;pm02 -isUserResetAllowed $true
In the following example, the Update-ManualUnmanagedPool cmdlet updates the configuration of an
unmanaged desktop pool named unman1.
Update-ManualUnmanagedPool -pool_id unman1 -displayName "Unmanaged Desktop 1"
-isUserResetAllowed $false
Displaying Information About Users and Groups
You can use the Get-User cmdlet to display information about Active Directory users and groups.
In the following example, the Get-User cmdlet displays information about all the users in a domain named
mydom.
Get-User -domain "mydom"
Chapter 3 Using View PowerCLI
VMware, Inc. 41