Welcome back to the Git Commit(ted) to </Dev> Resources series, where today we feature some of my favorite {code} Samples for VMware Horizon. If you’ve been following along with the series, then you’ll no doubt have a grasp of the fundamentals of coding against the Horizon APIs. These resources will provide you with examples of how to put those fundamentals into practice.
Postman Collection – Horizon REST API
Over the last several releases, the REST API has seen many additions, bringing it closer in parity to the SOAP-based API presented through PowerCLI.
While the official API documentation does give us many insights into its uses, our very own Chris Halstead has taken it one step further by creating a Postman Collection.
If you don’t have Postman already, you can demo it right from your browser using Postman for Web.
Figure 1: The Postman Collection for Horizon, demonstrated in Postman for Web
Chris has worked diligently to expose every available method each time the API sees an update.
Create or Reset VMs
If you’ve ever spent any considerable time administering Horizon, chances are that image management and creation is one your most time-consuming tasks. Thanks to Graeme Gordon's Create or Reset VMs script, however, that doesn’t have to be the case.
The script interacts with Microsoft Deployment Toolkit (MDT) to automate the creation of images used in the provisioning of Horizon desktops. The biggest advantage of automating this process is that you can start with a brand-new, clean image every time. This results in less bloat and a more consistent deployment.
Included in the bundle, you’ll find two key files:
- CreateResetVM.ps1 – the main script itself
- VMList.csv – the configuration file for the script
Once you’ve downloaded the script, you’ll want to head over to Using Automation to Create Optimized Windows Images for VMware Horizon VMs to learn how to use it.
Get Instant Clone Pool Information
If you’ve ever wanted to delve into the inner workings of the anatomy of an Instant Clone, then look no further than Mark McGill’s Get Instant Clone Pool Information script. Using this script, you’ll be able to map out all the internal VMs (parent, replicate, template, and master) that a particular Instant Clone depends on, as well as how much space it consumes.
One other feature is the ability to spot orphaned VMs, though that should be a rare occurrence.
Detect Instant Clone from within VM
Chris Halstead once again delivers an incredibly useful, but simple script to Detect if a VM is an Instant Clone from within the VM.
It does this by first detecting the presence of the Horizon Agent. It then checks if the VM is an Instant Clone, and if so, if it is a Type A (traditional) or Type B (parent-less) clone.
Use this in any script or customization where you need to identify the clone type before taking action.
PersonaManagement to FSLogix Migration
There are many options to move away from Persona Management, of course, one of which being the usage of FSLogix Profile Disks. To make this migration somewhat simpler, Chris Halstead comes to the rescue with his PersonaManagement-to-FSLogixProfileContainer-Migration script.
This script accomplishes this feat, in short by:
- Creating a VHD or VHDX disk, compatible with the FSLogix Profile Container
- Mounting the VHD(X)
- Copying the target user’s Persona to the FSLogix Profile Container
Once complete, you’ll be one step further along on your VDI Modernization journey.
Summary
I hope that you’ve found these resources helpful. Be sure to leave a comment with your favorite VMware {code} Sample for Horizon!
Agenda
Make sure to check out the other blog posts in our 28-day 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