Scripted Creation of XenApp and XenDesktop Admin Scopes and Roles


Often times it is necessary to set up multiple identical sites. One key tenant in enabling efficient IT delivery today is having automation. As administrators, you must find the balance between the need to automate and the deadline for delivery. To that end, rather than focusing on an end-to-end automated site install (where others have done an excellent job at that!) I wanted to focus on an often overlooked but valuable feature of XenApp and XenDesktop 7.x – Roles and Scopes.

By default, XenApp and XenDesktop 7.x come with a number of pre-defined roles that are fairly functional – Read Only, Help Desk Administrator, Full Administrator, Host Administrator, and Machine Catalog Administrator. Most Citrix Admins I know generally receive Full Administrator and provide Help Desk Administrator to their users. However, there is one default in that role that can be problematic in the wrong hands: Reset profile. To that end, I like to create a slightly more “restricted” Help Desk role that removes this singular permission. Additionally, in Director, the Help Desk Administrator cannot see Trends, Dashboard, or Filters. For that, we will create an “Operator” role.

First, a function to create the roles.

Next, a function to create the Administrators themselves.

Finally, we create the scopes

To use these functions, we require CSV data. The CSVs require all fields specified in the function comments. In order to obtain the permission names, I suggest you manually create the role with the desired permissions, then click the “Citrix Studio” node, find the Powershell tab, then copy the permissions from that tab. It will save a significant amount of time.

Finally, we need to call these functions. Here we will populate the path to our CSV sheets.

Repeat this on each additional XenApp and XenDesktop site you need to, or combine with other methods. You can create delegated administration in mere moments!

Leave a Reply