Scripts For Updating Connection Strings in XenApp/XenDesktop 7.x
book
Article ID: CTX221389
calendar_today
Updated On:
Description
This is an update to the blog post about updating connection strings for 7.x. It has been 2 years since that post, and XenApp/XenDesktop has gained a few new services (app library, orchestration and trust), this script has been updated to include those new services.
The whitespace in the DBConnectionStringFuncs.ps1 file has been updated, to use spaces (rather than a mixtures of tabs and spaces) and also some of the extraneous output has been removed from a few powershell calls.
This has been tested out with a 7.13 six DDC environment, and it successfully updated the connection strings for all services on all six controllers.
The scripts are expected to work with any controller running 7.1 or later, as some services are viewed as "optional", and won't be updated if they aren't present.
The scripts run the same as before, run the one script you need for what you're doing:
- DBConnectionStringFuncs.ps1 – this is the core script, and does the actual work. It contains common functions which the following scripts then use.
- Change_XD_Failover_Partner_v1.ps1 – this is similar to the previous script I posted, and is used to update the failover partner.
- Change_XD_To_ConnectionString.ps1 – this takes passed in connection strings and uses them, so a very generic version.
- Change_XD_To_MultiSubnetFailover.ps1 – this toggles the MultiSubnetFailover. If it doesn't exist or is false, it sets it to true. If it's set to true, the script sets it back to false. If you need to remove the option then you'll need to use Change_XD_To_ConnectionString.ps1 and provide strings without the setting.
- Change_XD_To_Null.ps1 – this is a reset of all the connection strings on the localhost as something has gone wrong. Note because this resets the connection strings to null, it will actually place the ddc into a “initial” state. IE if you run studio it’ll ask if you want to create a site, or join to another ddc. This is useful if something has gone wrong, as you can reset a controllers settings, and then attempt to set the connection strings again using Change_XD_To_ConnectionString.ps1.
If you need to do some kind of connection string manipulation feel free to look at how the Change_XD scripts use the functions in DBConnectionStringFuncs.ps1.
The updated scripts are zipped up on ShareFile:
https://citrix.sharefile.com/d-s85365ee48b84ad3b
Environment
The above mentioned sample code is provided to you as is with no representations, warranties or conditions of any kind. You may use, modify and distribute it at your own risk. CITRIX DISCLAIMS ALL WARRANTIES WHATSOEVER, EXPRESS, IMPLIED, WRITTEN, ORAL OR STATUTORY, INCLUDING WITHOUT LIMITATION WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NONINFRINGEMENT. Without limiting the generality of the foregoing, you acknowledge and agree that (a) the sample code may exhibit errors, design flaws or other problems, possibly resulting in loss of data or damage to property; (b) it may not be possible to make the sample code fully functional; and (c) Citrix may, without notice or liability to you, cease to make available the current version and/or any future versions of the sample code. In no event should the code be used to support ultra-hazardous activities, including but not limited to life support or blasting activities. NEITHER CITRIX NOR ITS AFFILIATES OR AGENTS WILL BE LIABLE, UNDER BREACH OF CONTRACT OR ANY OTHER THEORY OF LIABILITY, FOR ANY DAMAGES WHATSOEVER ARISING FROM USE OF THE SAMPLE CODE, INCLUDING WITHOUT LIMITATION DIRECT, SPECIAL, INCIDENTAL, PUNITIVE, CONSEQUENTIAL OR OTHER DAMAGES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. Although the copyright in the code belongs to Citrix, any distribution of the sample code should include only your own standard copyright attribution, and not that of Citrix. You agree to indemnify and defend Citrix against any and all claims arising from your use, modification or distribution of the sample code.
Issue/Introduction
This is an update to the blog post about updating connection strings for 7.x. It has been 2 years since that post, and XenApp/XenDesktop has gained a few new services (app library, orchestration and trust), this script has been updated to include those new services.
Was this article helpful?
thumb_up
Yes
thumb_down
No