XenMobile Script to add Device Policies to Delivery Group

I was asked by Carl Behrent (@carlbehrent) if it was possible to create a bundle of Device Policies and bind the bundle to a Delivery Group rather than having to bind each policy to the Delivery Group.

In fact it’s not possible for now to accomplish that with XenMobile Web Console.

So I start looking with Rest API to see if something could be done.

During my test I discovered what I called a “Bug”, referenced here after on another Article:

XenMobile Rest API => Edit Delivery Group Bug

Finally, I found the solution and create a script to accomplish that.

Note: For this script, Device Policies need to be configured on the XMS.

I will show you here after detailed steps on how the script works:

  • You first launch the script and you are asked for the URL of the XMS (it can be an IP as well).

  •  After providing the requested information and press Enter, the script check for the name (if FQDN provided) and if port 4443 is accessible from you desktop. A pop-up appears to request credentials.

  • Provide Credentials and press Enter (credentials must be a local account with ADMIN Role).

  • A list a available Delivery Group is displayed and you are asked to select the DG for which you want to add Device Policies.

  • After providing the Delivery Group name and pressing Enter, a list of the currently configured Device Policies appears and you are asked for the number of new Device Policies you want to add

  • After providing the number of Device Policies you want to add and pressing Enter you are asked for the name of the Device Policy (if more than 1 DP, you will be asked for name of each)

  • After providing the name of the “last” Device Policy you want to add and press Enter, the script runs and after successful update a message appears 

Note: A control is done for the name of the Device Policy.

We can check on the Web Console that the new Device Policies have been added:

I am still looking for a way to retrieve and display all the existing Device Policies to make choice more simple but for now, it’s not possible and you will need to know and provide the exact name of each.

The script can be downloaded here


Note: Those information are provided based on my own experience.