How to Redeploy XenDesktop Without Re-Installing
To clean the environment and remove the database, perform the following steps:
Load a PowerShell window as a full administrator (this is the administrator that was used to previous deploy XenDesktop)
Run the following command to initialise the PowerShell environment.
Add-PSSnapin Citrix.*
Inform the services to not use a database:
Set-ConfigDBConnection -DBConnection $null
Set-AcctDBConnection -DBConnection $null
Set-HypDBConnection -DBConnection $null
Set-ProvDBConnection -DBConnection $null
Set-PvsVmDBConnection -DBConnection $null
Set-BrokerDBConnection -DBConnection $null
Make sure these commands are run on every Desktop Delivery Controller that was previously set up to use the same database or deployment.
You should now have no connections on the database. Go to the database server and drop the database.
Now that the database has been dropped. Go to the first (or only) XenDesktop Deployment Controller and restart Desktop Studio. Desktop Studio will load with the initial setup options, following these options as if you have just installed XenDesktop.
source: http://support.citrix.com/article/CTX127421
Note: Different versions of SQLExpress store the sqlcmd command in different directories. It’s easiest to use Windows Explorer to search C:\Program Files\Microsoft SQL Server for the correct location.
- Change to the binary directory where sqlcmd resides:
cd \Program Files\Microsoft SQL Server\100\Tools\Binn<enter> - Connect to the local SQLExpress database instance:
sqlcmd -S localhost\SQLEXPRESS<enter> - List the databases to determine the name of the database to drop:
sp_databases<enter>
go<enter> - Drop the database
drop database CitrixXenDesktopDB<enter>
go<enter> - List the databases again to validate it is no longer there:
sp_databases<enter>
go<enter> - Exit sqlcmd:
exit<enter>