Score:0

How to recreate RDS High Availability database if the database is lost?

uy flag

I have Windows Server 2016 RDS farm which contains 16 servers. All these servers are configured for High Availability and use same database on SQL cluster.

If this database would be lost for some reason - how do I recreate database from scratch? I do not care about recreation of all collections and remote apps.

I tried to uninstall all RDS roles, including Connection Broker role. But then - if I try to install roles again - I have no option to create new database. It try to connect to old databse, which was before uninstallation. It seems to store database settings somewhere in the registry.

I tried to use Set-RDConnectionBrokerHighAvailability command. The result is The RD Connection Broker server is configured for high availability. So it says the High Availability is already configured on connection broker (even though I reinstalled all RDS roles)

I tried to use Set-RDDatabaseConnectionString -DatabaseConnectionString "DRIVER={ODBC Driver 13 for SQL Server};SERVER=tcp:SQL_cluster.company.local,1433;DATABASE=RDBANK2;APP=Remote Desktop Services Connection Broker;Trusted_Connection=Yes;" command. The result is:

Update-DBConnStringWithDatabaseAccess : Exception calling "GetConnectionString" : ""
At 
C:\Windows\system32\WindowsPowerShell\v1.0\Modules\RemoteDesktop\Deployment.psm1:1876 
char:19
+ ...   $result = Update-DBConnStringWithDatabaseAccess -ConnectionBroker $ ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : 
Microsoft.PowerShell.Commands.WriteErrorException,Update- 
DBConnStringWithDatabaseAccess

Get-WmiObject : Cannot validate argument on parameter 'ComputerName'. The argument is 
null or empty. Provide an argument that is not null or empty, and then try the 
command again.
At C:\Windows\system32\WindowsPowerShell\v1.0\Modules\RemoteDesktop\Utility.psm1:1977 
char:117
+ ... Properties -Namespace root\cimv2 -ComputerName $broker.Server -Authen ...
+                                                    ~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidData: (:) [Get-WmiObject], 
ParameterBindingValidationException
    + FullyQualifiedErrorId : 
ParameterArgumentValidationError,Microsoft.PowerShell.Commands.GetWmiObjectCommand

If I first move RDS High Availability database to another SQL server and then use Set-RDDatabaseConnectionString command pointing to database that was moved - the command completes successfully.

How do I recreate RDS High Availability database if it is lost? Is it possible to completely reset RDS Connection Broker configuration and then recreate it from scratch? Reinstalling of all 16 servers from scratch would be a nightmare.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.