Introducing PowerShell CLIs for VMware View

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.”

Bothered by SLOW Web UI to manage vSphere? Want to manage ALL your VMware vCenters, AWS, Azure, Openstack, container behind a SINGLE pane of glass? Want to search, analyze, report, visualize VMs, hosts, networks, datastores, events as easily as Google the Web? Find out more about vSearch 3.0: the search engine for all your private and public clouds.

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...

This entry was posted in Virtualization and tagged , , . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

2 Comments

  1. Posted February 16, 2011 at 3:13 am | Permalink

    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. Posted February 16, 2011 at 10:50 am | Permalink

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

    Steve

One Trackback

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

  • NEED HELP?


    My company has created products like vSearch ("Super vCenter"), vijavaNG APIs, EAM APIs, ICE tool. We also help clients with virtualization and cloud computing on customized development, training. Should you, or someone you know, need these products and services, please feel free to contact me: steve __AT__ doublecloud.org.

    Me: Steve Jin, VMware vExpert who authored the VMware VI and vSphere SDK by Prentice Hall, and created the de factor open source vSphere Java API while working at VMware engineering. Companies like Cisco, EMC, NetApp, HP, Dell, VMware, are among the users of the API and other tools I developed for their products, internal IT orchestration, and test automation.