How-to Register a VDA to a XenDesktop Controller?

There are a lot of questions about how-to register the VDA to the desired DDC or DDC’s. Citrix has its own Policies. And those policies are configurable in the Active Directory and in the Desktop Studio. Which is leading? And what are those settings? Must I use Active Directory Discovery (FarmGUID) or Registry Discovery (ListOfDDCs)?

The Setup:

My setup is simple:

  • 2x a XenDesktop Controller (XenDesktop and XenDesktop2);
  • 1x a Windows7 machine;
  • The XenDesktop Controllers are hosting there own XenDesktop farm.

The VDA Installation:

The VDA installation asks the controller location:

clip_image002[7]

  • Manually enter controller location;
    • This is know as the Registry Discovery. On the client there will be a list with the DDC’s;
  • Select from Active Directory;
    • This is know as the Active Directory Discovery. On the client there will be a FarmGUID. In the AD there is a relation between the FarmGUID and the DDC’s;
  • Configure at a later time;
    • This is most the most flexible way. On the client there is no list, or what so ever, with DDC’s to contact.

In all the examples below, I have chosen: Configure at a later time. So I have to do it manually.

Registry Discovery:

When Registry Discovery is used. The following registry key (Type RES_SZ) is added to the client:

  • 32Bit: HKEY_LOCAL_MACHINE\Software\Citrix\VirtualDesktopAgent\ListOfDDCs
  • 64Bit: HKEY_LOCAL_MACHINE\Software\Wow6432Node\Citrix\VirtualDesktopAgent\ListOfDDCs

The data in the key is the FQDN of the DDC’s to use. For instance:

  • XenDesktop.JeroenTielen.Local (Use the first DDC);
  • XenDesktop2.JeroenTielen.Local (Use the second DDC);
  • XenDesktop.JeroenTielen.Local XenDesktop2.JeroenTielen.Local (It will randomly select a DDC and uses another until a successful connection is established).

When this registry key is in place and the “Citrix Desktop Service” service is restarted, the Desktop is successful  registered.

clip_image004

To make this more dynamically/flexible. This key can be deployed by a Group Policy using Preferences.

clip_image006

This method is easy to implement. When a VDA is moved between Organizational Units the policy on the specific OU will instruct the VDA to the correct DDC.

Note: When a Citrix Policy is configured in the Desktop Studio, instructing the VDA to contact a specific DDC, this interfere with the GPO. This Citrix Policy is kept on the client. When changing OU/GPO this setting will always kicks in. Delete the file: “C:\Program Files\Citrix\Virtual Desktop Agent\Policy\FAMachinePolicyRules.xml” and reboot the VDA will solve the problem. When using a GPO for Registry discovery, don’t set a Citrix Policy in the Desktop Studio.

Active Directory Discovery:

To enable Active Directory Discovery you first need to start a PowerShell script on 1 DDC in the Farm. This script is located in the following directory: “C:\Program Files\Citrix\Broker\Service\Setup Scripts” and is named: “Set-ADControllerDiscovery.ps1”

In this example I’m going to use the same OU as where my computer accounts exists:

.\Set-ADControllerDiscovery.ps1  -on –existingOuDn “OU=Win7, OU=Test, DC=JeroenTielen, DC=local”

clip_image008

This will add DDC information into the specified OU. Within this information there is a group named: “Controllers”. All DDC’s computer accounts are placed into this group. Making it easy to change DDC’s. (Just add the correct DDC into the group.)

clip_image010

Before you continue, restart on all DDC’s the “Citrix Broker Service” service.

In the results of the PowerShell script, there is a line saying:

  • Important: You must make sure that your VDAs are using the correct OU (e.g. set  HKLM\SOFTWARE\Citrix\VirtualDesktopAgent\FarmGUID to “ID”).

The following registry key (Type RES_SZ) must be added to the client:

  • 32Bit: HKEY_LOCAL_MACHINE\Software\Citrix\VirtualDesktopAgent\FarmGUID
  • 64Bit: HKEY_LOCAL_MACHINE\Software\Wow6432Node\Citrix\VirtualDesktopAgent\FarmGUID

The data in the key is the “ID” found in the result of the PowerShell script. In my case:

  • 51C37CDF-3CA7-4237-B2A5-7803138DBC5C

clip_image012

When this registry key is in place and the “Citrix Desktop Service” service is restarted, the Desktop is successful registered.

To make this more dynamically/flexible. This key can be deployed by a Group Policy using Preferences.

clip_image014

This method is easy to implement. When a VDA is moved between Organizational Units the policy on the specific OU will instruct the VDA to the correct DDC.

Note: When a Citrix Policy is configured in the Desktop Studio, instructing the VDA to contact a specific DDC, this interfere with the GPO. This Citrix Policy is kept on the client. When changing OU/GPO this setting will always kicks in. Delete the file: “C:\Program Files\Citrix\Virtual Desktop Agent\Policy\FAMachinePolicyRules.xml” and reboot the VDA will solve the problem. When using a GPO for Active Directory discovery, don’t set a Citrix Policy in the Desktop Studio.

Citrix Active Directory Policy

If you install GPMC on a DDC or install Desktop Studio and GPMC on a management workstation. You can create a Citrix Policy direct on a specific OU. This will direct the VDA to register itself with the specified DDC’s.

clip_image016

This policy is only viewable on a machine where the desktop studio is installed.

clip_image018

Citrix Policy

Within the Citrix policies in the Desktop Studio. There is an option to configure the controller. This policy will overrule all settings above. But keep in mind. To apply this policy the VDA must first register with the DDC. So first you need to use some methods above and then a Citrix Policy to overrule that setting. Not ideal 😉

Hopefully this post will clear up any questions about how-to register a VDA with a DDC or DDC’s.

Was once an enthusiastic PepperByte employee but is now working elsewhere. His blogs are still valuable to us and we hope to you too.

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *