VMware View 介绍PowerShell的命令行界面(CLI)

460阅读 0评论2013-10-08 wfeng
分类:系统运维

当我挖苦的VMware View的API几个问我,如果在那里他们可以找到查看的API虽然VMware提供全套的API确实提供了基于PowerShell的命令行记录的VMware View集成指南

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

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 ]...
Cmdlet          Add-AutomaticPool                                   Add-AutomaticPool [-pool_id ] [-descript...
Cmdlet          Add-ManualPool                                      Add-ManualPool [-pool_id ] [-description...
Cmdlet          Add-ManualUnmanagedPool                             Add-ManualUnmanagedPool [-pool_id ] [-de...
Cmdlet          Add-PoolEntitlement                                 Add-PoolEntitlement [-pool_id ] [-sid ] [-des...
Cmdlet          Add-ViewVC                                          Add-ViewVC [-serverName ] [-Name ] [-domain ...
Cmdlet          Get-ConnectionBroker                                Get-ConnectionBroker [[-broker_id] ] [...
Cmdlet          Get-DesktopPhysicalMachine                          Get-DesktopPhysicalMachine [-displayName ] [-Name ] [-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 ] [-poolDis...
Cmdlet          Get-Monitor                                         Get-Monitor [-monitor ] [-monitor_id <...
Cmdlet          Get-Pool                                            Get-Pool [-pool_id ] [-displayName ] [-Ve...
Cmdlet          Get-ProfileDisk                                     Get-ProfileDisk [-Name ] [-Username ] [-pool_...
Cmdlet          Get-TerminalServer                                  Get-TerminalServer [-displayName ] [-d...
Cmdlet          Get-User                                            Get-User [-includeUser] [-includeGroup] [-name <...
Cmdlet          Get-ViewVC                                          Get-ViewVC [-displayName ] [-descripti...
Cmdlet          Remove-Pool                                         Remove-Pool [-pool_id ] [-DeleteFromDisk...
Cmdlet          Remove-PoolEntitlement                              Remove-PoolEntitlement [-pool_id ] [-sid...
Cmdlet          Remove-UserOwnership                                Remove-UserOwnership [[-machine_id] ] [-...
Cmdlet          Remove-ViewVC                                       Remove-ViewVC [-vc_id ] [-Name ]...
Cmdlet          Send-LinkedCloneRebalance                           Send-LinkedCloneRebalance [-machine_id ]...
Cmdlet          Send-LinkedCloneRecompose                           Send-LinkedCloneRecompose [-machine_id ]...
Cmdlet          Send-LinkedCloneRefresh                             Send-LinkedCloneRefresh [-machine_id ] [...
Cmdlet          Send-LocalSessionRollback                           Send-LocalSessionRollback [-machine_id ]...
Cmdlet          Send-SessionDisconnect                              Send-SessionDisconnect [[-session_id] ] ...
Cmdlet          Send-SessionLogoff                                  Send-SessionLogoff [[-session_id] ] [-Ve...
Cmdlet          Send-VMReset                                        Send-VMReset [-machine_id ] [-id ] [-Verbose] [-Debug] ...
Cmdlet          Update-AutomaticLinkedClonePool                     Update-AutomaticLinkedClonePool [-pool_id ] [-descr...
Cmdlet          Update-ConnectionBroker                             Update-ConnectionBroker [-broker_id ] [-...
Cmdlet          Update-GlobalSetting                                Update-GlobalSetting [-SessionTimeout ] ...
Cmdlet          Update-ManualPool                                   Update-ManualPool [-pool_id ] [-descript...
Cmdlet          Update-ManualUnmanagedPool                          Update-ManualUnmanagedPool [-pool_id ] [...
Cmdlet          Update-TerminalServerPool                           Update-TerminalServerPool [-pool_id ] [-...
Cmdlet          Update-UserOwnership                                Update-UserOwnership [-machine_id ] [-si...
Cmdlet          Update-ViewVC                                       Update-ViewVC [-vc_id ] [-serverName 
上一篇:网络监控 iptraf安装配置使用中文文档
下一篇:Linux Kernel command line 内核输入参数/proc