6.2

Table Of Contents
VMware, Inc. 45
Chapter 3 Using View PowerCLI
Return a list of active persistent user data disks for the virtual machine vm01.
Get-ProfileDisk -VMname vm01
Reset the virtual machines for the desktop pool dtpool-05.
Get-Pool -pool_id dtpool-05 | Get-DesktopVM | Send-VMReset
Reset the virtual machine for the desktop pool with the display name dtp1.
Get-Pool -displayName dtp1 | Get-DesktopVM | Send-VMReset
Displaying Information About Physical Computers
Return information about the computer at a specified IP address.
Get-DesktopPhysicalMachine -hostname myhost01
Updating the Ownership of Machines
Update the ownership of the virtual machine vm04 to the user usr1.
Update-UserOwnership -machine_id (Get-DesktopVM -Name "vm04").machine_id
-sid (Get-User -name usr1).sid
Remove the ownership of a virtual machine.
Remove-UserOwnership -machine_id (Get-DesktopVM -Name "vm22").machine_id
Displaying Information About Events
Display the views that are available for reporting events.
Get-EventReportList
Display configuration change events that have occurred since the specified date.
Get-EventReport -viewName config_changes -startDate (Get-Date -Year 2011 -Month 5 -Day 20 -Hour 0
-Minute 0 -Second 0)
Display user events that occurred between two specified dates.
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)
Display user events for the last 24 hours.
Get-EventReport -viewName user_events -startDate ((Get-Date).AddDays(-1))
Display user events for the current year.
Get-EventReport -viewName user_events -startDate (Get-Date -Day 01 -Month 01 -Hour 0 -Minute 0
-Second 0)
Managing the Global Configuration of View
Display the global configuration settings.
Get-GlobalSetting
Set the session timeout to 30 minutes.
Update-GlobalSetting -SessionTimeout 1800
NOTE The -SessionTimeout value is measured in seconds. In View Administrator, the Session timeout value
is measured in minutes. If View PowerCLI generates a value that is less than 60 seconds, View Administrator
rounds down, resulting in a value of 0. To set a session timeout in View PowerCLI, specify a
-SessionTimeout
value of 60 (one minute) or greater.
N
OTE View Agent must be running on the computers.