Howdy folks…It’s time to right a small wrong and provide you all with the complete 4 Step Process for Manually Joining a new Controller to an existing Site. It’s Time to JUST BLOG IT!!!

Previously, I had written that this task was a simple 3 step process and for the most part it is, so if you have already followed the 3 step process then don’t panic just yet. The original process works fine as i’m sure anyone who has followed the steps could attest to.  The only problem with the 3 step process is that it is missing one very important step (step 4 maybe???) for completeness which pretty much ensures that you won’t have any issues long term if you ever decided to remove the very first site Controller. let me know explain…

The long and short of step 4 is that unless we update each of the service group memberships within the site and inform them that a new configuration service instance is available then all services on all controllers will continue to use the first controllers configuration service essentially creating a single point of failure. It’s a failure you may never see unless you actually remove the original Controller but if you did then your site would grind to a half. It’s for this reason that I wanted to go back and visit this topic.

So here you are once more friends of @XDtipster. The same information as per my original blog but with the 4th and final step thrown in for good mesure. :-)

Safe Reading & Enjoy!!!

P.S. BIG thank you to the esteemed William Charnell (Sr XD Architect) for his insight.

Manually Joining a new Controller to an existing Site (New & Improved 4 Step Process)

Environment Details:
SQL server = sqlserver.training.lab
XenDesktop DB name = CitrixXenDesktopDB
New Controller = dc2.training.lab

Step 1: Create an instance Script for each service running on the new Controller (dc2.training.lab) and execute against the Site database (as usual, query’s must be run in SQLCMD mode):

XD5.x

Get-BrokerDBSchema -DatabaseName CitrixXenDesktopDB -ScriptType instance > c:\brokerjoin.sql
Get-ConfigDBSchema -DatabaseName CitrixXenDesktopDB -ScriptType instance > c:\configjoin.sql
Get-HypDBSchema -DatabaseName CitrixXenDesktopDB -ScriptType instance > c:\hostjoin.sql
Get-ProvDBSchema -DatabaseName CitrixXenDesktopDB -ScriptType instance > c:\provjoin.sql
Get-PvsVmDBSchema -DatabaseName CitrixXenDesktopDB -ScriptType instance > c:\pvsvmjoin.sql
Get-AcctDBSchema -DatabaseName CitrixXenDesktopDB -ScriptType instance > c:\adjoin.sql

XD7.x

Get-BrokerDBSchema -DatabaseName CitrixXenDesktopDB -ScriptType instance > c:\brokerjoin.sql
Get-ConfigDBSchema -DatabaseName CitrixXenDesktopDB -ScriptType instance > c:\configjoin.sql
Get-HypDBSchema -DatabaseName CitrixXenDesktopDB -ScriptType instance > c:\hostjoin.sql
Get-ProvDBSchema -DatabaseName CitrixXenDesktopDB -ScriptType instance > c:\provjoin.sql
Get-AcctDBSchema -DatabaseName CitrixXenDesktopDB -ScriptType instance > c:\adjoin.sql
Get-AdminDBSchema -DatabaseName CitrixXenDesktopDB -ScriptType instance > c:\adminjoin.sql
Get-LogDBSchema -DatabaseName CitrixXenDesktopDB -ScriptType instance > c:\logjoin.sql
Get-EnvTestDBSchema -DatabaseName CitrixXenDesktopDB -ScriptType instance > c:\envtestjoin.sql
Get-MonitorDBSchema -DatabaseName CitrixXenDesktopDB -ScriptType instance > c:\monitorjoin.sql
Get-SfDBSchema -DatabaseName CitrixXenDesktopDB -ScriptType instance > c:\sfjoin.sql

Step 2: Set the DB connection string for each of the new controller services:

XD5.x

Set-BrokerDBConnection -DBConnection “Server=sqlserver.training.lab;Initial Catalog = CitrixXenDesktopDB; Integrated Security =True”
Set-ConfigDBConnection -DBConnection “Server=sqlserver.training.lab;Initial Catalog = CitrixXenDesktopDB; Integrated Security = True”
Set-HypDBConnection -DBConnection “Server=sqlserver.training.lab;Initial Catalog = CitrixXenDesktopDB; Integrated Security = True”
Set-ProvDBConnection -DBConnection “Server=sqlserver.training.lab;Initial Catalog = CitrixXenDesktopDB; Integrated Security = True”
Set-PvsVmDBConnection -DBConnection “Server=sqlserver.training.lab;Initial Catalog = CitrixXenDesktopDB; Integrated Security =True”
Set-AcctDBConnection -DBConnection “Server=sqlserver.training.lab;Initial Catalog = CitrixXenDesktopDB; Integrated Security = True”

XD7.x

Set-AdminDBConnection -DBConnection “Server=sqlserver.training.lab;Initial Catalog = CitrixXenDesktopDB; Integrated Security =True”
Set-BrokerDBConnection -DBConnection “Server=sqlserver.training.lab;Initial Catalog = CitrixXenDesktopDB; Integrated Security =True”
Set-ConfigDBConnection -DBConnection “Server=sqlserver.training.lab;Initial Catalog = CitrixXenDesktopDB; Integrated Security = True”
Set-HypDBConnection -DBConnection “Server=sqlserver.training.lab;Initial Catalog = CitrixXenDesktopDB; Integrated Security = True”
Set-ProvDBConnection -DBConnection “Server=sqlserver.training.lab;Initial Catalog = CitrixXenDesktopDB; Integrated Security = True”
Set-AcctDBConnection -DBConnection “Server=sqlserver.training.lab;Initial Catalog = CitrixXenDesktopDB; Integrated Security = True”
Set-EnvTestDBConnection -DBConnection “Server=sqlserver.training.lab;Initial Catalog = CitrixXenDesktopDB; Integrated Security =True”
Set-MonitorDBConnection -DBConnection “Server=sqlserver.training.lab;Initial Catalog = CitrixXenDesktopDB; Integrated Security = True”
Set-SfDBConnection -DBConnection “Server=sqlserver.training.lab;Initial Catalog = CitrixXenDesktopDB; Integrated Security = True”
Set-LogDBConnection -DBConnection “Server=sqlserver.training.lab;Initial Catalog = CitrixXenDesktopDB; Integrated Security = True”

Notes:
-If using XD7.x, The delegated administration service (alias=admin) must be the first service you set the DB connection string for. If not then all other strings above will fail/Timeout. This is expected behaviour as all services communicate with the the delegated administration service in order to validate the permissions to make changes to the site DB and this includes the action to set the DB connection string.

-Force switch was introduced in XD7.1 and can be used to force the DBConnection strings even if the DBConnection for the delegated administration service has not been set. Using the -force switch allows you to order the services in the script above any way you like.

Step 3: Register the new controllers service instances with the existing site Configuration Service:

XD5.x

Get-BrokerServiceInstance | Register-ConfigServiceInstance
Get-ConfigServiceInstance | Register-ConfigServiceInstance
Get-HypServiceInstance | Register-ConfigServiceInstance
Get-ProvServiceInstance | Register-ConfigServiceInstance
Get-PvsVmServiceInstance | Register-ConfigServiceInstance
Get-AcctServiceInstance | Register-ConfigServiceInstance

XD7.x

Get-BrokerServiceInstance | Register-ConfigServiceInstance
Get-ConfigServiceInstance | Register-ConfigServiceInstance
Get-HypServiceInstance | Register-ConfigServiceInstance
Get-ProvServiceInstance | Register-ConfigServiceInstance
Get-AcctServiceInstance | Register-ConfigServiceInstance
Get-AdminServiceInstance | Register-ConfigServiceInstance
Get-LogServiceInstance | Register-ConfigServiceInstance
Get-EnvTestServiceInstance | Register-ConfigServiceInstance
Get-MonitorServiceInstance | Register-ConfigServiceInstance
Get-SfServiceInstance | Register-ConfigServiceInstance

Step 4: Reset the service group membership call for each service group. This script forces each service group to record the updated set of configuration service endpoints in its own database area, as the set of config service endpoints now includes the new ones from the new controller just added to the site.

XD5.x

get-ConfigServiceInstance | Reset-BrokerServiceGroupMembership
get-ConfigServiceInstance | Reset-ConfigServiceGroupMembership
get-ConfigServiceInstance | Reset-HypServiceGroupMembership
get-ConfigServiceInstance | Reset-ProvServiceGroupMembership
get-ConfigServiceInstance | Reset-PvsVmServiceGroupMembership
get-ConfigServiceInstance | Reset-AcctServiceGroupMembership

XD7.x

get-ConfigServiceInstance | Reset-ConfigServiceGroupMembership
get-ConfigServiceInstance | Reset-AcctServiceGroupMembership
get-ConfigServiceInstance | Reset-AdminServiceGroupMembership
get-ConfigServiceInstance | Reset-BrokerServiceGroupMembership
get-ConfigServiceInstance | Reset-EnvTestServiceGroupMembership
get-ConfigServiceInstance | Reset-HypServiceGroupMembership
get-ConfigServiceInstance | Reset-LogServiceGroupMembership
get-ConfigServiceInstance | Reset-MonitorServiceGroupMembership
get-ConfigServiceInstance | Reset-ProvServiceGroupMembership
get-ConfigServiceInstance | Reset-SfServiceGroupMembership

If anyone has any questions or is having any problems following the updated steps above let me know in the comments section below.

Best Regards
Mick Glover (aka XD Tipster)
Senior Readiness Specialist,
Worldwide Support Readiness [EMEA]
Citrix Systems, Inc