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

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
Summary
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.
Agenda
And make sure to check out the other blog posts in our month-long series:
- Day 1: Let's Git Commit(ted) to Dev Resources
- Day 2: Getting Started with the Workspace ONE UEM REST APIs
- Day 3: Getting Started with the Workspace ONE Access APIs
- Day 4: Getting Started with the VMware Workspace ONE Intelligence APIs
- Day 5: Getting Started with the VMware Horizon REST APIs and VMware PowerCLI
- Day 6: Getting Started with Automating the Unified Access Gateway Deployment
- Day 7: Podcast: Day 0 Onboarding Automation with Scot Curry
- Day 8: Video: Anatomy of the Workspace ONE UEM API
- Day 9: Introduction to using Postman - Part 1
- Day 10: Introduction to using Postman - Part 2
- Day 11: Pro Tips and Tricks - How to be an API Boss
- Day 12: What is OAuth - Learning the Basics
- Day 13: Getting Started with Intelligent Hub Notifications
- Day 14: Git Basics: Getting Git Going
- Day 15: Podcast: Git Commit(ted) to Resources: Customer Spotlight with The Home Depot
- Day 16: Git VMware {code} Samples and Flings
- Day 17: Using paginated requests with Workspace ONE UEM REST APIs
- Day 18: Event Notifications
- Day 19: Overview of Script Samples using PowerCLI for Horizon
- Day 20: Uploading Windows apps using REST APIs
- Day 21: Uploading macOS apps using REST APIs and Admin Assistant
- Day 22: API-based user lifecycle and SCIM
- Day 23: Video: Community Expert Roundtable on Leveraging APIs and Scripting
- Day 24: Video: Exploring the Workspace ONE GitHub Samples Repository
- Day 25: Featured Fling: Forklift for Workspace ONE UEM
- Day 26: Featured VMware {code} Samples for Horizon
- Day 27: Featured Flings for VMware Horizon
- Day 28: Continuing to Focus on </Dev> Resources Page