< Back

Set-RDDatabaseConnectionString

Thu Apr 04, 2019 5:42 am

NAME Set-RDDatabaseConnectionString



SYNOPSIS

Configures the database connection string for the database server used in a high availability environment.





SYNTAX

Set-RDDatabaseConnectionString [[-DatabaseConnectionString] <String>] [[-DatabaseSecondaryConnectionString] <String>] [[-ConnectionBroker]

<String>] [[-RestoreDatabaseConnection]] [[-RestoreDBConnectionOnAllBrokers]] [<CommonParameters>]





DESCRIPTION

The Set-RDDatabaseConnectionString cmdlet configures database connection settings for the database server used in a high availability environment

with multiple Remote Desktop Connection Broker (RDConnection Broker) servers.



High availability supports multiple RDConnection Broker roles and servers, and uses a database server to store the configuration information for RD

Connection Broker servers.





PARAMETERS

-ConnectionBroker [<String>]

Specifies the RDConnection Broker server for a remote desktop deployment. If you do not supply a value, the cmdlet uses the fully qualified

domain name (FQDN) of the local computer.



Required? false

Position? 3

Default value none

Accept pipeline input? false

Accept wildcard characters? false



-DatabaseConnectionString [<String>]

Specifies the database connection string. The database connection string supports both high availability configurations:



-- Dedicated database server. Uses Windows Authentication to connect to the databse.

-- Shared database server. Uses database authentication (such as SQL authentication) with a user name and password to connect to the database.



Required? false

Position? 1

Default value none

Accept pipeline input? false

Accept wildcard characters? false



-DatabaseSecondaryConnectionString [<String>]

Specifies the secondary database connection string optionally used to support password expiration. Specify the secondary connection string if

the high availability configuration uses a shared database server in which authentication to the database requires a user name and password.



Required? false

Position? 2

Default value none

Accept pipeline input? false

Accept wildcard characters? false



-RestoreDatabaseConnection [<SwitchParameter>]

Indicates that this operation restores the database connection string(s) when database access is lost for dedicated or shared configurations.



You can use Set-RDDatabaseConnectionString on the active management broker to restore the database connection string(s) on the specified

broker, or you can specify the RestoreDBConnectionOnAllBrokers parameter to restore the database connection string(s) on all RD Connection

Brokers in the deployment.



Required? false

Position? 4

Default value none

Accept pipeline input? false

Accept wildcard characters? false



-RestoreDBConnectionOnAllBrokers [<SwitchParameter>]

Indicates that this operation restores the database connection string(s) on all RD Connection Brokers in a deployment to re-establish database

connectivity. If you specify this parameter, you must also specify the RestoreDatabaseConnection parameter.



Required? false

Position? 5

Default value none

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).



INPUTS









OUTPUTS

Null









Example 1: Set a remote desktop database connection string



PS C:\\> Set-RDDatabaseConnectionString -ConnectionBroker "Rdcb.Contoso.com" -DatabaseConnectionString "DRIVER=SQL Server Native Client

10.0;SERVER=Sqlserver.Contoso.com;Trusted_Connection=Yes;APP=Remote Desktop Services Connection Broker;Database=RemoteDesktopDeployment"



This command sets the database connection string for the RD?? Connection Broker named Rdcb.Contoso.com.





Example 2: Set a remote desktop secondary database connection string



PS C:\\>Set-RDDatabaseConnectionString -ConnectionBroker "Rdcb.Contoso.com" ????????DatabaseSecondaryConnectionString "DRIVER=SQL Server Native Client

10.0;SERVER=Sqlserver.Contoso.com; Uid=admin1;Pwd= OtherPassword!;Encrypt=yes;Connection Timeout=30;;APP=Remote Desktop Services Connection

Broker;Database=RemoteDesktopDeployment"



This command sets the secondary database connection string for the RD?? Connection Broker named Rdcb.Contoso.com.





Example 3: Update a database connection string on an RD Connection Broker server



PS C:\\>Set-RDDatabaseConnectionString -ConnectionBroker "Rdcb.Contoso.com" ????????DatabaseConnectionString "DRIVER=SQL Server Native Client

10.0;SERVER=Sqlserver.Contoso.com; Uid=admin1;Pwd= OtherPassword1!;Encrypt=yes;Connection Timeout=30;APP=Remote Desktop Services Connection

Broker;Database=RemoteDesktopDeployment" ????????DatabaseSecondaryConnectionString "DRIVER=SQL Server Native Client 10.0;SERVER=Sqlserver.Contoso.com;

Uid=admin2;Pwd= OtherPassword2!;Encrypt=yes;Connection Timeout=30;APP=Remote Desktop Services Connection Broker;Database=RemoteDesktopDeployment"

????????RestoreDatabaseConnection



This command sets the primary and secondary database connection strings for the RDConnection Broker named Rdcb.Contoso.com after the connection to

the database is lost. Connectivity can be lost if the password expires or if the database administrator changes the connection string.





Example 4: Update database connection strings on all RD Connection Broker servers



PS C:\\>Set-RDDatabaseConnectionString -ConnectionBroker "Rdcb.Contoso.com" ????????DatabaseConnectionString "DRIVER=SQL Server Native Client

10.0;SERVER=Sqlserver.Contoso.com; Uid=admin1;Pwd= OtherPassword1!;Encrypt=yes;Connection Timeout=30;APP=Remote Desktop Services Connection

Broker;Database=RemoteDesktopDeployment" ????????DatabaseSecondaryConnectionString "DRIVER=SQL Server Native Client 10.0;SERVER=Sqlserver.Contoso.com;

Uid=admin2;Pwd= OtherPassword2!;Encrypt=yes;Connection Timeout=30;APP=Remote Desktop Services Connection Broker;Database=RemoteDesktopDeployment"

????????RestoreDatabaseConnection -RestoreDBConnectionOnAllBrokers



This command sets the primary and secondary database connection strings for all the RDConnection Broker servers in a deployment after the

connection to the database is lost. Connectivity can be lost if the password expires or if the database administrator changes the connection

string.







RELATED LINKS

Online Version: http://go.microsoft.com/fwlink/?LinkId=294257

Remove-RDDatabaseConnectionString