4.6

Table Of Contents
VMware, Inc. 43
Chapter 3 Using View PowerCLI
ReturninformationaboutthevirtualmachinesthataremanagedbythesamevCenterServerthatprovisions
thedesktoppooldtpool1.
Get-ViewVC -pool_id dtpool-1 | Get-DesktopVM
ReturninformationaboutallvirtualmachinesthataremanagedbythevCenterServerthatisconfiguredon
theservervc01.mydom.int.
Get-ViewVC -serverName vc01.mydom.int | 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
Updatetheownershipofthevirtualmachinevm04totheuserusr1.
Update-UserOwnership -machine_id (Get-DesktopVM -Name "vm04").machine_id
-sid (Get-User -name usr1).sid
Removetheownershipofavirtualmachine.
Remove-UserOwnership -machine_id (Get-DesktopVM -Name "vm22").machine_id
Displaying Information About Events
Displaytheviewsthatareavailableforreportingevents.
Get-EventReportList
Displayconfigurationchangeeventsthathaveoccurredsincethespecifieddate.
Get-EventReport -viewName config_changes -startDate (Get-Date -Year 2011 -Month 5 -Day 20 -Hour 0
-Minute 0 -Second 0)
Displayusereventsthatoccurredbetweentwospecifieddates.
Get-EventReport -viewName user_events -startDate (Get-Date -Year 2011 -Month 12 -Day 1 -Hour 0
-Minute 0 -Second 0) -endDate (Get-Date -Year 2011 -Month 12 -Day 2 -Hour 0 -Minute 0 -Second 0)
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
NOTEViewAgentmustberunningonthecomputers.