How to Re-deploy XenDesktop without Reinstalling

How to Re-deploy XenDesktop without Reinstalling

book

Article ID: CTX127421

calendar_today

Updated On:

Description

How to reset or redeploy a XenDesktop environment without having to re-install the Desktop Delivery Controllers (DDC). 

Note: To reset XenDesktop, Citrix recommends to uninstall all the Desktop Delivery Controller (DDC) machines before removing the database. When any setup issues occur, uninstalling can be a time consuming process. So, this article describes how to clean up the environment without reinstalling the system.

Requirements

You must be able to run PowerShell as a XenDesktop Full Administrator (the same administrator was previously used to deploy XenDesktop), or if XenDesktop has not been set up, you must be a Domain Administrator.


Instructions

To clean the environment and remove the database, complete the following steps:

  1. Load a PowerShell window as a Full Administrator..

  2. Run the following command to initialize the PowerShell environment:

    Add-PSSnapin Citrix.*
  1. Nullify the connection strings from the registry via PowerShell so that the controller does not connect to the database:

    Set-AcctDBConnection -DBConnection $null
    Set-AnalyticsDBConnection -DBConnection $null
    Set-AppLibDBConnection -DBConnection $null
    Set-BrokerDBConnection -DBConnection $null
    Set-EnvTestDBConnection -DBConnection $null
    Set-HypDBConnection -DBConnection $null
    Set-MonitorDBConnection -DataStore Monitor -DBConnection $null
    Set-MonitorDBConnection -DBConnection $null
    Set-OrchDBConnection -DBConnection $null
    Set-ProvDBConnection -DBConnection $null
    Set-SfDBConnection -DBConnection $null
    Set-TrustDBConnection -DBConnection $null

    Set-LogDBConnection -DataStore Logging -DBConnection $null -Force
    Set-LogDBConnection -DBConnection $null -Force
    Set-ConfigDBConnection -DBConnection $null -Force
    Set-AdminDBConnection -DBConnection $null -Force
     

Note: Ensure that these commands run on every DDC that was previously set up to use the same database or deployment.

You must now have no connections on the database.

  1. Access the database server and remove the database (optional step).

  2. After removing the database, access the first (or only) XenDesktop Controller and restart Desktop Studio.

  3. After Desktop Studio is restarted, it will load with the initial setup options as if you have just installed XenDesktop.

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 article describes how to re-deploy XenDesktop without reinstalling.