7.0

Table Of Contents
Table 321. Examples of Common Virtual Machine Management Tasks (Continued)
Task Example View PowerCLI cmdlet Syntax
Get information about the virtual machines
managed by the same vCenter Server
instance that provisions a specific desktop
pool
Get-ViewVC -pool_id dtpool-1 | Get-DesktopVM
Get information about all the virtual
machines managed by a specific vCenter
Server instance
Get-ViewVC -serverName vc01.mydom.int | Get-DesktopVM
List all the active persistent user data disks
for a specific virtual machine
Get-ProfileDisk -VMname vm01
Reset all the virtual machines for a specific
desktop pool
Get-Pool -pool_id dtpool-05 | Get-DesktopVM | Send-VMReset
Reset the virtual machine for a desktop pool
that has a specific display name
Get-Pool -displayName dtp1 | Get-DesktopVM | Send-VMReset
Displaying Information About Physical Machines
You can use the Get-DesktopPhysicalMachine cmdlet to display information about a physical machine.
In this example, the Get-DesktopPhysicalMachine cmdlet displays information about a physical machine that
has a specific IP address.
Get-DesktopPhysicalMachine -hostname myhost01
Updating Virtual Machine Ownership
You can use the Update-UserOwnership and Remove-UserOwnership cmdlets to update ownership for virtual
machines.
In this example, the Update-UserOwnership cmdlet updates the ownership of a virtual machine named vm04
for a user named user1.
Update-UserOwnership -machine_id (Get-DesktopVM -Name "vm04").machine_id
-sid (Get-User -name usr1).sid
In this example, the Remove-UserOwnership cmdlet removes the ownership of a virtual machine named
vm22.
Remove-UserOwnership -machine_id (Get-DesktopVM -Name "vm22").machine_id
Displaying Event Reports
You can use View PowerCLI cmdlets to display event reports.
Table 322. Examples of Common Event Reporting Tasks
Task Example View PowerCLI cmdlet Syntax
List all the available event reporting
views
Get-EventReportList
Display all the configuration change
events that occurred after a specific date
Get-EventReport -viewName config_changes -startDate (Get-Date
-Year 2011 -Month 5 -Day 20 -Hour 0 -Minute 0 -Second 0)
Display all the user events that occurred
between two specific 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)
Chapter 3 Using View PowerCLI
VMware, Inc. 45