Share this post

I have been playing with the powershell for some time now and honestly speaking I’m a big fan of this tool. I’m not a programmer and I have to learn powershell from scratch but I see that this is a right direction I have to follow. The most “natural” method to accelerate and simplify XenDesktop deployment is to use powershell scripts to perform unattended installation and configuration.

I decided to write next series of articles focused on XenDesktop 7.6, similar to my XenApp 7.5 Quick Installation Guide but in this guide we will do everything in powershell.

The note for the reader:

  • if you want to see how to install and configure XenDesktop 7.6 using standard GUI, follow XenApp 7.5 Quick Installation Guide as the installation procedure for version XenDesktop 7.5 and 7.6 is the same.
  • if you want to use powershell to configure XenDesktop 7.6 stay with me in this article – we will learn together how to do so.

The XenDesktop 7.6 install with powershell guide will consist of following articles:

Part 1 – Installation and site configuration

Part 2 – Install and configure VDA

Part 3 – Create and configure machine catalog (comming soon)

Part 4 – Create and configure delivery group (comming soon)

Part 5 – Configure StoreFront (comming soon)

In this article will show how to :

  1. Perform unattended XenDesktop 7.6 installation
  2. Create a new XenDesktop database
  3. Create a new XenDesktop site
  4. Add license server information
  5. Add and configure XenDesktop site administrators
  6. Add additional delivery controller to an existing XenDesktop site
  7. Remove delivery controller from XenDesktop site

So, let’s start …

Step 1 – XenDesktop 7.6 unattended installation.

As I mentioned above I will install and configure all components in powershell but to be honest I was not able to complete the first step: I was not able to perform unattended install with more than 1 component. As it is shown in Figure 1 finally I installed XenDesktop from command prompt.

Using command line or powershell we can deploy XenDesktop 7.6 using the XenDesktopServerSetup.exe located in “iso:x64\XenDesktop Setup” folder. In my case I installed 3 main components without SQL database using the command shown in Figure 1 below.


Figure 1

Using powershell I was able to install only one component as it is shown in Figure 2 but when I tried to add more components to be installed I received an error shown in Figure 3.


Figure 2

Installation error:


Figure 3

Finally fresh XenDesktop 7.6 instance has been installed and we are ready to start configuration part which is more complicated but still pretty straightforward when we have a cheat sheet on the table.

Step 2 – Create a XenDesktop databases.

In FMA world all information about XenDesktop 7.x sites are kept in SQL database. Before we start to configure XenDesktop we have to create a database where configuration will be stored. According to the Citrix best practice it is recommended to configure XenDesktop 7.x site with separate databases storing site configuration, configuration logging and monitoring data separately.

Important note: When XenDesktop 7.x installation is done using classic graphical interface a single database is used to store all information and some manual tasks are required to split configuration into separate databases. For detailed steps see my post: Xendesktop 7 configuration logging explained

To create the databases and the schema for XenDesktop we will use powershell command: New-XDDataBase as it is shown in Figure 4 below. The parameter -DataStore is used to apply corresponding schema to the specified database. You have to run separate command for each database.


Figure 4

 Step 3 – Create a new XenDesktop site

When databases are ready we will create XenDesktop site using powershell command: New-XDSite as it is shown in Figure 5.


Figure 5

 Step 4 – Add license server information

When XenDesktop site is created we have to preform basic site configuration. We have to configure the site to use license server with correct product license. As a initial step we have to configure license server using powershell command: Set-XDLicensing as it is shown in Figure 6.


Figure 6

When the XenDesktop site is configured with valid license server the site is automatically configured with the highest product code and product version available with existing license. The initial site configuration can be displayed using powershell command: Get-ConfigSite as it is shown in Figure 7.


Figure 7

In the next step you might want to configure XenDesktop site to use different licensing model or product edition. Available options can be displayed using the following powershell commands:
Get-ConfigProducts, Get-ConfigProductVersion, Get-ConfigLicencingModel, Get-ConfigProductEdition

The available options are shown in Figure 8 below.


Figure 8

If you want to change any of the parameters described above you have to execute powershell command Get-ConfigSite with required parameters. In my case I changed product version to XenApp and product edition to Enterprise. The result is shown in Figure 9.


Figure 9

 Step 5 – Add and configure XenDesktop site administrators

By default the user who preformed the installation is added to the XenDesktop administrators group. To display current configuration you can execute powershell command Get-AdminAdministrator. The result is shown in Figure 10.


Figure 10

In order to add and configure new administrator you have to execute powershell command New-AdminAdministrator to add new entry and Add-AdminRight to assign appropriate role. The results and syntax are shown in Figure 11.


Figure 11

The current – updated configuration for Site administrators is listed in Figure 12


Figure 12

 Step 5 – Add additional delivery controller

In the previous steps new XenDesktop site has been created and configured. Now we would like to add additional delivery controller to make the infrastructure available for user when first controller will be in the maintenance mode. As the first task we need to install XenDesktop components using command using the same procedure as described in the Step 1 above. The result is shown in Figure 13 above.


Figure 13

 When XenDesktop components are installed we have to add new controller to the existing XenDesktop site using powershell command Add-XDController. The syntax is shown in Figure 14.


Figure 14

 Because Add-XDController command does not return the execution status it’s a good practice to verify the site configuration using Get-XDSite command. The expected result is to have both delivery controllers listed site configuration. The result is shown in Figure 15


Figure 15

 In order to remove delivery controller you need to execute the Remove-XDController command where ControlerName is the controller you want to remove and AdminAddress is the name of the controler powershell command will connect to. The syntax is shown in Figure 16


Figure 16


Important note:

The the existing site you can add controllers with the same version as the controllers currently installed. If you try to add controller installed with different XenDesktop version you will get the error as it shown in Figure 17.


Figure 17

At this stage we have our XenDesktop 7.6 site installed and configured. In the next article I will cover VDA installation with powershell. Stay tuned for update.