4.6

Table Of Contents
VMware, Inc. 41
Chapter 3 Using View PowerCLI
Get-DesktopVM -pool_id lcdpool_2 | Send-LinkedCloneRebalance -schedule 2011-05-10:01:00:00
-forceLogoff $false -stopOnError $true
Refreshtheoperatingsystemdiskofeachlinkedclonedesktopbyrestoringittoitsoriginalstateandsize.
Get-DesktopVM -pool_id lcdpool_2 | Send-LinkedCloneRefresh -schedule "May 12 2011 01:15"
-forceLogoff $true -stopOnError $true
Recomposealllinkedclonedesktopsfromasnapshotoftheirparentvirtualmachine.
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
CreateamanuallyprovisioneddesktoppoolthatcontainsthevirtualmachinemyVM.TousetheGet-VM
cmdlet,youmustinstallvSpherePowerCLI.
Add-ManualPool -pool_id manPool -id (Get-VM -name "myVM").id -isUserResetAllowed $true
Createthemanuallyprovisioneddesktoppoolman1fromthedesktopslistedbythevCenterServer
vc.mydom.int.
Get-ViewVC -serverName vc.mydom.int | Get-DesktopVM -poolType Manual | Add-ManualPool -pool_id
man1 -isUserResetAllowed $false
Updatetheconfigurationofthemanuallyprovisioneddesktoppoolman1.
Update-ManualPool -pool_id man1 -displayName "Manual Desktop 1" -isUserResetAllowed $true
Creating Manual Unmanaged Desktop Pools
Createtheunmanageddesktoppoolunman1thatcontainsthephysicalmachinespm01andpm02.
Add-ManualUnmanagedPool -pool_id unman1 -pm_id_list pm01;pm02 -isUserResetAllowed $true
Updatetheconfigurationoftheunmanageddesktoppoolunman1.
Update-ManualUnmanagedPool -pool_id unman1 -displayName "Unmanaged Desktop 1"
-isUserResetAllowed $false
Creating and Updating Desktops Provisioned by Terminal Servers
Returninformationaboutaterminalserver.
Get-TerminalServer -hostname tsvr01
Addthedesktoppooltsd1usingamachinethatisprovidedbytheterminalserverataspecifiedIPaddress.
Get-TerminalServer -hostname tsvr01 | Add-TerminalServerPool -pool_id tsd1 -displayName "Terminal
Server Desktop 1" -allowProtocolOverride $true
Updatetheconfigurationofthedesktoppooltsd1,whichusesamachineprovidedbyaterminalserver.
Get-TerminalServer -hostname tsvr01 | Update-TerminalServerPool -pool_id tsd1 -displayName
"Terminal Server Desktop 1" -allowProtocolOverride $false -autoLogoffTime 1
Obtaining Information About Users and Groups from Active Directory
Returninformationaboutusersinthedomainmydom.
Get-User -domain "mydom"
Returninformationabouttheuserfredinthedomainmydomandexcludeanyinformationabouttheusers
group.
Get-User -name "fred" -domain "mydom" -includeGroup $false