Let’s Git Commit(ted) to </Dev> Resources: Getting Started with the VMware Horizon REST APIs and VMware PowerCLI

February 05, 2022

Welcome to Day 5 of Let’s Git Commit(ted) to </Dev> Resources!  Our theme of introducing developer resources for VMware Workspace ONE and VMware Horizon continues with today’s discussion of leveraging the VMware Horizon REST APIs and VMware PowerCLI.

Unlike previous discussions, VMware Horizon has two options for programmatic control and automation: VMware PowerCLI and VMware Horizon REST APIs.

VMware PowerCLI

VMware PowerCLI is a command-line interface (CLI) and scripting tool built on Windows PowerShell that provides more than 800 cmdlets! VMware PowerCLI allows you to manage and automate several VMware products such as VMware vSphere, vRealize Operations Manager, VMware NSX-T Data Center, and more. Today’s discussion will focus on the available VMware Horizon cmdlets.

VMware PowerCLI provides two cmdlets for Horizon: Connect-HVServer and Disconnect-HVServer, which allow you to connect and disconnect from the View API service. Once connected, you have access to the full View APIs to allow you to automate your Horizon environment. For a deeper dive on getting started with VMware PowerCLI, the available Horizon cmdlets, and various samples, see Graeme Gordon’s blog on Automating VMware Horizon 7 with VMware PowerCLI.

You should consider using VMware PowerCLI if:

  • Programmatically connecting, disconnecting, and running Horizon View APIs from Microsoft PowerShell (such as getting a list of desktops, their state, and connections) would be beneficial
  • Your team is familiar with or interested in developing solutions with Microsoft PowerShell
  • Having access to more than 800 PowerShell cmdlets for various VMware products would provide a great foundation for your automation and reporting layers

VMware Horizon REST APIs

A library of RESTful (restful state transfer) APIs for automating and reporting on your VMware Horizon environment are also available. REST APIs rely on web requests, which allows you to develop tools and automation in your language of choice rather than requiring Microsoft PowerShell as seen with VMware PowerCLI.

The REST APIs have endpoints for authentication, managing inventory (such as desktop pools, application pools, and farms), monitoring services (such as AD domains, connection servers, Event databases) and much more! For a deeper diver on the VMware Horizon REST APIs, see Chris Halstead’s article on Using the VMware Horizon Server REST API.

You should consider using the VMware Horizon REST APIs if:

  • Programmatically automating and managing your Horizon environment using web requests with the language of your choice rather than Microsoft PowerShell is appealing
  • Having consistency between accessing different products (both VMware and 3rd party) with RESTful APIs is appealing


We hope this introduction has helped you understand the options available to you when automating your VMware Horizon environment. Be sure to review the linked articles for a deeper dive on both topics.


And make sure to check out the other blog posts in our month-long series:

Filter Tags

Workspace ONE Workspace ONE Access Workspace ONE Intelligence Workspace ONE UEM Blog Technical Overview Intermediate Optimize