How To Manually Join A New Controller To An Existing Site

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

With the release of XenDesktop 7.6, an instance script must also be created for the Analytics service:

Get-AnalyticsDBSchema -DatabaseName CitrixXenDesktopDB -ScriptType instance > c:analyticsjoin.sql

With the release of XenDesktop 7.8, an instance script must also be created for the App Library service:

Get-AppLibDBSchema -DatabaseName CitrixXenDesktopDB -ScriptType instance > c:applibjoin.sql

With the release of XenDesktop 7.1x, an instance script must also be created for the Trust Service and Orchestration service:

Get-TrustDBSchema -DatabaseName CitrixXenDesktopDB -ScriptType instance > c:Trustjoin.sql

Get-OrchDBSchema -DatabaseName CitrixXenDesktopDB -ScriptType instance > c:Orchjoin.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”

With the release of XenDesktop 7.6, a DB connection string must also be set for the Analytics service:

Set-AnalyticsDBConnection -DBConnection “Server=sqlserver.training.lab;Initial Catalog=CitrixXenDesktopDB;Integrated Security=True”

With the release of XenDesktop 7.8, a DB connection string must also be set for the App Library service :

Set-AppLibDBConnection -DBConnection “Server=sqlserver.training.lab;Initial Catalog=CitrixXenDesktopDB;Integrated Security=True”

With the release of XenDesktop 7.1x, a DB connection string must also be set for the Trust Service and Orchestration service :

Set-TrustDBConnection -DBConnection “Server=sqlserver.training.lab;Initial Catalog=CitrixXenDesktopDB;Integrated Security=True”

Set-OrchDBConnection -DBConnection “Server=sqlserver.training.lab;Initial Catalog=CitrixXenDesktopDB;Integrated Security=True”

Notes:

-If using XenDesktop 7.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 XenDesktop 7.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:

XenDesktop 5.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

XenDesktop 7.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


With the release of XenDesktop 7.6, the Analytics service must also be registered with the existing Site Configuration Service:

Get-AnalyticsServiceInstance | Register-ConfigServiceInstance

With the release of XenDesktop 7.8, the App Library service must also be registered with the existing Site Configuration Service:

Get-AppLibServiceInstance | Register-ConfigServiceInstance

With the release of XenDesktop 7.1x, the Trust service and Orchestration service must also be registered with the existing Site Configuration Service:

Get-TrustServiceInstance | Register-ConfigServiceInstance

Get-OrchServiceInstance | 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.

XenDesktop 5.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

XenDesktop 7.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


With the release of XenDesktop 7.6, the group membership call must also be reset for the Analytics service group:

get-ConfigServiceInstance | Reset-AnalyticsServiceGroupMembership

With the release of XenDesktop 7.8, the group membership call must also be reset for the App Library service group:

get-ConfigServiceInstance | Reset-AppLibServiceGroupMembership

With the release of XenDesktop 7.1x, the group membership call must also be reset for the Trust service and Orchestration service group:

get-ConfigServiceInstance | Reset-TrustServiceGroupMembership

get-ConfigServiceInstance | Reset-OrchServiceGroupMembership

At last do not forget to set the secondary datastore connection string for Monitor and Log databases:-

Set-logdbconnection -datastore logging -dbconnection “Server=sqlserver.training.lab;Initial Catalog=CitrixXenDesktopDBLogging;Integrated Security=True”

Set-Monitordbconnection -datastore monitor -dbconnection “Server=sqlserver.training.lab;Initial Catalog=CitrixXenDesktopDBMonitoring;Integrated Security=True”

Related:

Leave a Reply