Automating Custom Icon Assignments in Omnissa Horizon using REST API

Delivering a polished and intuitive user experience is essential. One often-overlooked detail is the assignment of custom icons to published applications, which can enhance usability and improve branding. Thankfully, with the Horizon REST API and a little PowerShell, this process can be fully automated.

In this post, we’ll walk through the essentials of the Horizon REST API and demonstrate how to automatically assign a custom icon to an application pool using a PowerShell script.

Introduction to the Omnissa Horizon REST API

Omnissa Horizon includes a RESTful API interface that allows administrators to programmatically manage the Horizon environment. This includes tasks such as:

  • Authenticating and obtaining access tokens.

  • Querying and managing inventory (e.g., application pools).

  • Uploading and associating application icons.

The API uses standard HTTP methods (GET, POST, etc.) and expects JSON-formatted requests and responses. Authentication is typically done using a bearer token obtained through a login endpoint.

Automating Custom Icon Assignment

The following PowerShell script automates the complete process of:

  1. Authenticating to the Horizon REST API.

  2. Uploading a custom icon.

  3. Fetching the application pool ID by name.

  4. Associating the uploaded icon with the specified application.

Here is the annotated PowerShell script:

Final Thoughts

This automation simplifies the process of maintaining a consistent and visually refined Horizon environment. While the script above is tailored to assign a custom icon to “Notepad”, it can be easily adapted for other applications by changing the value field in the filter section.

With the Horizon REST API, such administrative tasks can be easily scripted, reducing the chances of error and saving valuable time for IT admins.

You may also like...