4.5

Table Of Contents
VMware, Inc. 43
Chapter 3 Using View PowerCLI
ReturninformationaboutallvirtualmachinesthataremanagedbythevCenterServerthatisconfiguredon
theservervc01.mydom.int.
Get-ViewVC -serverName vc01.mydom.int | Get-DesktopVM
Returninformationaboutthevirtualmachinesthatareconfiguredasmanualdesktoppools,andwhichare
managedbyvCenterServersthatareconfiguredonserversintheDNSdomainmycorp.com.
Get-ViewVC -serverName *.mycorp.com -DesktopType Manual | Get-DesktopVM
Returnalistofactivepersistentuserdatadisksforthevirtualmachinevm01.
Get-ProfileDisk -VMname vm01
Resetthevirtualmachinesforthedesktoppooldtpool05.
Get-Pool -pool_id dtpool-05 | Get-DesktopVM | Send-VMReset
Resetthevirtualmachineforthedesktoppoolwiththedisplaynamedtp1.
Get-Pool -displayName dtp1 | Get-DesktopVM | Send-VMReset
Displaying Information About Physical Computers
ReturninformationaboutthecomputerataspecifiedIPaddress.
Get-DesktopPhysicalMachine -hostname myhost01
Updating the Ownership of Machines
Updatetheownershipofthevirtualmachinevm04.
Update-UserOwenership -machine_id vm04 -sid S-1-5-21-7623811015-3361044348-030300820-1013
Removetheownershipofavirtualmachine.
Remove-UserOwenership -machine_id vm22
Displaying Information About Events
Displaytheviewsthatareavailableforreportingevents.
Get-EventReportList
Displayconfigurationchangeeventsthathaveoccurredsincethespecifieddate.
Get-EventReport -viewName config_changes -startDate 2011-05-20:00:00:00
Displayusereventsthatoccurredbetweentwospecifieddates.
Get-EventReport -viewName user_events -startDate 2011-12-01:00:00:00 -endDate 2011-12-02:00:00:00
Displayusereventsforthelast24hours.
Get-EventReport -viewName user_events -startDate ((Get-Date).AddDays(-1))
Displayusereventsforthecurrentyear.
Get-EventReport -viewName user_events -startDate (Get-Date -Day 01 -Month 01 -Hour 0 -Minute 0
-Second 0)
Managing the Global Configuration of VMware View
Displaytheglobalconfigurationsettings.
Get-GlobalSetting
Setthesessiontimeoutto30minutes.
Update-GlobalSetting -SessionTimeout 30
NOTEViewAgentmustberunningonthecomputers.