Home > Virtualization > Introducing PowerShell CLIs for VMware View

Introducing PowerShell CLIs for VMware View

February 16th, 2011 Leave a comment Go to comments

Two weeks ago when I twitted about VMware View APIs, several folks asked me if and where they could find View APIs. While VMware does not provide a full set of APIs, but does offer PowerShell based CLI as documented in the VMware View Integration Guide.

Beyond that, the guide also introduces the event database with tables and schemas so that you can retrieve various events from the database directly; how to import/export LDAP data to/from View; and how to “use Microsoft System Center Operations Manager (SCOM) to monitor the state of VMware View components, including View Connection Server instances and security servers and View services running on these hosts.”

Time to learn how to "Google" and manage your VMware and clouds in a fast and secure

HTML5 App

While trying the PowerShell CLI, I found the setup instruction is slightly different from my environment where View 4.5 is installed. After installing two basic components as stated in the doc: .NET Framework 2.0 (newer version should work but I didn’t try), and PowerShell 1.0 English Language Installation, I could not find the Start>All Programs>VMware>View>View PowerCLI, therefore could not run the cmdlets afterwards.

Here’s what I did to make it work after a little research on the Internet:

1.       Install/register the View PowerShell snap-in dll;

PS> C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\installutil "C:\Program Files\VMware\VMware View\Server\bin\PowerShellServiceCmdlets.dll"

Then, the View snap-in shows with another cmdlet:

PS> get-PSsnapin –registered

2.       Add the View broker snap-in

PS> add-pssnapin VMware.View.Broker

Once it’s done, you can list all the cmdlets:

PS> Get-Command -PSSnapin VMware.View.Broker | more

By then I could follow the guide to move forward.

Here are the comlets available (as the output of above cmdlet) so that you can have a sense what you can do with them. For more details, you can either use the Get-Help cmdlet or read the guide.

CommandType     Name                                                Definition
-----------     ----                                                ----------
Cmdlet          Add-AutomaticLinkedClonePool                        Add-AutomaticLinkedClonePool [-pool_id <String>]...
Cmdlet          Add-AutomaticPool                                   Add-AutomaticPool [-pool_id <String>] [-descript...
Cmdlet          Add-ManualPool                                      Add-ManualPool [-pool_id <String>] [-description...
Cmdlet          Add-ManualUnmanagedPool                             Add-ManualUnmanagedPool [-pool_id <String>] [-de...
Cmdlet          Add-PoolEntitlement                                 Add-PoolEntitlement [-pool_id <String>] [-sid <S...
Cmdlet          Add-TerminalServerPool                              Add-TerminalServerPool [-pool_id <String>] [-des...
Cmdlet          Add-ViewVC                                          Add-ViewVC [-serverName <String>] [-Name <String...
Cmdlet          Get-ComposerDomain                                  Get-ComposerDomain [-vc_id <String[]>] [-domain ...
Cmdlet          Get-ConnectionBroker                                Get-ConnectionBroker [[-broker_id] <String[]>] [...
Cmdlet          Get-DesktopPhysicalMachine                          Get-DesktopPhysicalMachine [-displayName <String...
Cmdlet          Get-DesktopVM                                       Get-DesktopVM [-vc_id <String[]>] [-Name <String...
Cmdlet          Get-EventReport                                     Get-EventReport [-viewName <String>] [-startDate...
Cmdlet          Get-EventReportList                                 Get-EventReportList [-Verbose] [-Debug] [-ErrorA...
Cmdlet          Get-GlobalSetting                                   Get-GlobalSetting [-Verbose] [-Debug] [-ErrorAct...
Cmdlet          Get-License                                         Get-License [-Verbose] [-Debug] [-ErrorAction <A...
Cmdlet          Get-LocalSession                                    Get-LocalSession [-pool_id <String[]>] [-poolDis...
Cmdlet          Get-Monitor                                         Get-Monitor [-monitor <String[]>] [-monitor_id <...
Cmdlet          Get-Pool                                            Get-Pool [-pool_id <String[]>] [-displayName <St...
Cmdlet          Get-PoolEntitlement                                 Get-PoolEntitlement [[-pool_id] <String[]>] [-Ve...
Cmdlet          Get-ProfileDisk                                     Get-ProfileDisk [-Name <String[]>] [-Username <S...
Cmdlet          Get-RemoteSession                                   Get-RemoteSession [-username <String[]>] [-pool_...
Cmdlet          Get-TerminalServer                                  Get-TerminalServer [-displayName <String[]>] [-d...
Cmdlet          Get-User                                            Get-User [-includeUser] [-includeGroup] [-name <...
Cmdlet          Get-ViewVC                                          Get-ViewVC [-displayName <String[]>] [-descripti...
Cmdlet          Remove-Pool                                         Remove-Pool [-pool_id <String>] [-DeleteFromDisk...
Cmdlet          Remove-PoolEntitlement                              Remove-PoolEntitlement [-pool_id <String>] [-sid...
Cmdlet          Remove-UserOwnership                                Remove-UserOwnership [[-machine_id] <String>] [-...
Cmdlet          Remove-ViewVC                                       Remove-ViewVC [-vc_id <String>] [-Name <String>]...
Cmdlet          Send-LinkedCloneRebalance                           Send-LinkedCloneRebalance [-machine_id <String>]...
Cmdlet          Send-LinkedCloneRecompose                           Send-LinkedCloneRecompose [-machine_id <String>]...
Cmdlet          Send-LinkedCloneRefresh                             Send-LinkedCloneRefresh [-machine_id <String>] [...
Cmdlet          Send-LocalSessionRollback                           Send-LocalSessionRollback [-machine_id <String>]...
Cmdlet          Send-SessionDisconnect                              Send-SessionDisconnect [[-session_id] <String>] ...
Cmdlet          Send-SessionLogoff                                  Send-SessionLogoff [[-session_id] <String>] [-Ve...
Cmdlet          Send-VMReset                                        Send-VMReset [-machine_id <String>] [-id <String...
Cmdlet          Set-License                                         Set-License [-key <String>] [-Verbose] [-Debug] ...
Cmdlet          Update-AutomaticLinkedClonePool                     Update-AutomaticLinkedClonePool [-pool_id <Strin...
Cmdlet          Update-AutomaticPool                                Update-AutomaticPool [-pool_id <String>] [-descr...
Cmdlet          Update-ConnectionBroker                             Update-ConnectionBroker [-broker_id <String>] [-...
Cmdlet          Update-GlobalSetting                                Update-GlobalSetting [-SessionTimeout <String>] ...
Cmdlet          Update-ManualPool                                   Update-ManualPool [-pool_id <String>] [-descript...
Cmdlet          Update-ManualUnmanagedPool                          Update-ManualUnmanagedPool [-pool_id <String>] [...
Cmdlet          Update-TerminalServerPool                           Update-TerminalServerPool [-pool_id <String>] [-...
Cmdlet          Update-UserOwnership                                Update-UserOwnership [-machine_id <String>] [-si...
Cmdlet          Update-ViewVC                                       Update-ViewVC [-vc_id <String>] [-serverName <St...

Categories: Virtualization Tags: , ,
  1. February 16th, 2011 at 03:13 | #1

    Although we can only applaud the existance of a snapin for View, there are some serious shortcomings. It’s as if the team that created the View snapin never looked at the PowerCLI snapin.
    See also Alan’s post http://www.virtu-al.net/2010/09/14/vmware-view-4-5-more-powershell-cmdlets/

  2. February 16th, 2011 at 10:50 | #2

    Thanks Luc! I will check out Alan’s post.

    Steve

  1. February 16th, 2011 at 01:39 | #1