How to configure XenDesktop to use Mirror database

During deployment of XenDesktop If you are using SQL Mirror in the way we recommend that users initialize XenDesktop site configuration Once configured Mirror, so that Connection string contains the default mirror database connection. But sometimes there will inevitably appear after the user to configure site configuration mirror, which would make things very complex, requiring dozens of command to reset the connection string all service slightest mistake could lead to environmental hang. Here I compiled a 2-period simple script for everyone to use.

Precautions

  1. Before modifying sure to do DB Snapshots and DDC
  2. This script applies only to 7.15 LTSR, the number of different versions of the service will vary, modify yourself

Specific steps

  1. We first need to DDC in the connection string blank, you can save it as a ps1 file content to be performed by the DDC administrator privileges
    Set-ItemProperty -Path HKLM: \ SOFTWARE \ Citrix \ DesktopServer \ DataStore \ Connections \ Controller ConnectionString $ null
    the Set-ItemProperty -Path HKLM: \ SOFTWARE \ the Citrix \ XDservices \ ADIdentitySchema \ DataStore \ Connections the ConnectionString $ null
    the Set-ItemProperty -Path HKLM: \ SOFTWARE \ the Citrix \ XDservices \ Analytics \ DataStore \ Connections the ConnectionString $ null
    the Set-ItemProperty -Path HKLM: \ SOFTWARE \ the Citrix \ XDservices \ AppLibrarySchema \ DataStore \ Connections the ConnectionString $ null
    the Set-ItemProperty -Path HKLM: \ SOFTWARE \ the Citrix \ XDservices \ ConfigLoggingSiteSchema \ DataStore \ Connections the ConnectionString $ null
    the Set-ItemProperty -Path HKLM: \ SOFTWARE \ the Citrix \ XDservices \ ConfigurationSchema \ DataStore \ Connections ConnectionString $ null
    Set-ItemProperty -Path HKLM:\SOFTWARE\Citrix\XDservices\DAS\DataStore\Connections ConnectionString $null
    Set-ItemProperty -Path HKLM:\SOFTWARE\Citrix\XDservices\DesktopUpdateManagerSchema\DataStore\Connections ConnectionString $null
    Set-ItemProperty -Path HKLM:\SOFTWARE\Citrix\XDservices\EnvTestServiceSchema\DataStore\Connections ConnectionString $null
    Set-ItemProperty -Path HKLM:\SOFTWARE\Citrix\XDservices\HostingUnitServiceSchema\DataStore\Connections ConnectionString $null
    Set-ItemProperty -Path HKLM:\SOFTWARE\Citrix\XDservices\Monitor\DataStore\Connections ConnectionString $null
    Set-ItemProperty -Path HKLM:\SOFTWARE\Citrix\XDservices\OrchestrationSchema\DataStore\Connections ConnectionString $null
    Set-ItemProperty -Path HKLM:\SOFTWARE\Citrix\XDservices\StorefrontSchema\DataStore\Connections ConnectionString $null
    Set-ItemProperty -Path HKLM:\SOFTWARE\Citrix\XDservices\TrustSchema\DataStore\Connections ConnectionString $null

  2. Restart DDC
  3. DDC reset the connection string on your own server address changes, save the file ps1 DDC executed by Powershell

Asnp citrix*
$cs="Server=DB.ctx.com;Failover Partner=DB2.ctx.com;Initial Catalog=Citrixsite;Integrated Security=True"
$cslog="Server=DB.ctx.com;Failover Partner=DB2.ctx.com;Initial Catalog=CitrixLogging;Integrated Security=True"
$csmonitor="Server=DB.ctx.com;Failover Partner=DB2.ctx.com;Initial Catalog=CitrixMonitoring;Integrated Security=True"

Set-ItemProperty -Path HKLM:\SOFTWARE\Citrix\DesktopServer\DataStore\Connections\Controller ConnectionString $cs
Set-ItemProperty -Path HKLM:\SOFTWARE\Citrix\XDservices\ADIdentitySchema\DataStore\Connections ConnectionString $cs
Set-ItemProperty -Path HKLM:\SOFTWARE\Citrix\XDservices\Analytics\DataStore\Connections ConnectionString $cs
Set-ItemProperty -Path HKLM:\SOFTWARE\Citrix\XDservices\AppLibrarySchema\DataStore\Connections ConnectionString $cs
Set-ItemProperty -Path HKLM:\SOFTWARE\Citrix\XDservices\ConfigLoggingSiteSchema\DataStore\Connections ConnectionString $cs
Set-ItemProperty -Path HKLM:\SOFTWARE\Citrix\XDservices\ConfigurationSchema\DataStore\Connections ConnectionString $cs
Set-ItemProperty -Path HKLM:\SOFTWARE\Citrix\XDservices\DAS\DataStore\Connections ConnectionString $cs
Set-ItemProperty -Path HKLM:\SOFTWARE\Citrix\XDservices\DesktopUpdateManagerSchema\DataStore\Connections ConnectionString $cs
Set-ItemProperty -Path HKLM:\SOFTWARE\Citrix\XDservices\EnvTestServiceSchema\DataStore\Connections ConnectionString $cs
Set-ItemProperty -Path HKLM:\SOFTWARE\Citrix\XDservices\HostingUnitServiceSchema\DataStore\Connections ConnectionString $cs
Set-ItemProperty -Path HKLM:\SOFTWARE\Citrix\XDservices\Monitor\DataStore\Connections ConnectionString $cs
Set-ItemProperty -Path HKLM:\SOFTWARE\Citrix\XDservices\OrchestrationSchema\DataStore\Connections ConnectionString $cs
Set-ItemProperty -Path HKLM:\SOFTWARE\Citrix\XDservices\StorefrontSchema\DataStore\Connections ConnectionString $cs
Set-ItemProperty -Path HKLM:\SOFTWARE\Citrix\XDservices\TrustSchema\DataStore\Connections ConnectionString $cs

Set-MonitorDBConnection -datastore Monitor -DBConnection $null
Set-MonitorDBConnection -datastore Monitor -DBConnection $csmonitor
Set-LogDBConnection -datastore Logging -DBConnection $null
Set-LogDBConnection -datastore Logging -DBConnection $cslog

  1. Restart DDC
  2. If you need to modify multiple DDC respectively

I hope to be helpful

Guess you like

Origin blog.51cto.com/virtuallife/2413966