Integration

Table Of Contents
Managing Virtual Machines
You can use View PowerCLI cmdlets to manage virtual machines. View Agent must be running in the
virtual machines.
Table 321. Examples of Common Virtual Machine Management Tasks
Task Example View PowerCLI cmdlet Syntax
Get information about the virtual machines
for a specific desktop pool
Get-DesktopVM -pool_id dtpool-3
Get information about the virtual machines
configured on a specific vCenter Server
instance
Get-DesktopVM -vc_id (Get-ViewVC -serverName
vc03.local.int).vc_id
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
Chapter 3 Using View PowerCLI
VMware, Inc. 43