Product Documentation

Test-BrokerDBConnection

Sep 29, 2015

Tests whether a database is suitable for use by the Citrix Broker Service.

Syntax

Test-BrokerDBConnection [-DBConnection] <String> [-AdminAddress <String>] [<CommonParameters>]

Detailed Description

Tests whether the database specified in the given connection string is suitable for use by the currently selected Citrix Broker Service instance.

The service attempts to contact the specified database and returns a status indicating whether the database is both contactable and usable. The test does not impact any currently established connection from the service instance to another database in any way. The tested connection string is not recorded.

Only use of Windows authentication within the connection string is supported; a connection string containing SQL authentication credentials is always rejected as invalid.

The current service instance is that on the local machine, or that explicitly specified by the last usage of the -AdminAddress parameter to a Broker SDK cmdlet.

Parameters

-DBConnection<String>

Specifies the database connection string to be tested by the currently selected Citrix Broker Service instance.

Required? true
Default Value  
Accept Pipeline Input? false

-AdminAddress<String>

Specifies the address of a XenDesktop controller that the PowerShell snapin will connect to. This can be provided as a host name or an IP address.

Required? false
Default Value Localhost. Once a value is provided by any cmdlet, this value will become the default.
Accept Pipeline Input? false

Return Values

System.String

The Test-BrokerDBConnection cmdlet returns a string describing the status of the selected Citrix Broker Service instance that would result if the connection string were used with the Set-BrokerDBConnection cmdlet; the actual current status of the service is not changed. Possible values are:

-- OK:

The service instance is configured with a valid database and service schema. The service is operational.

-- DBUnconfigured:

No database connection string is set for the service instance.

-- DBRejectedConnection:

The database server rejected the logon from the service instance. This is typically caused by invalid credentials.

-- InvalidDBConfigured:

The specified database does not exist, is not visible to the service instance, or the service's schema within the database is invalid.

-- DBNotFound:

The specified database could not be located with the given connection string.

-- DBNewerVersionThanService:

The service instance is older than, and incompatible with, the service's schema in the database. The service instance needs upgrading.

-- DBOlderVersionThanService:

The service instance is newer than, and incompatible with, the service's schema in the database. The database schema needs upgrading.

-- DBVersionChangeInProgress:

A database schema upgrade is in progress.

-- PendingFailure:

Connectivity between the service instance and the database has been lost. This may be a transitory network error, but may indicate a loss of connectivity that requires administrator intervention.

-- Failed:

Connectivity between the service instance and the database has been lost for an extended period of time, or has failed due to a configuration problem. The service instance cannot operate while its connection to the database is unavailable.

-- Unknown:

Service status cannot be determined.

Examples

-------------------------- EXAMPLE 1 --------------------------

C:\PS>Test-BrokerDBConnection "Server=dbserver\SQLEXPRESS;Database=XDDB;Trusted_Connection=True"

Tests whether the service instance could use a database called XDDB on an SQL Server Express database running on the machine called dbserver. Integrated Windows authentication is required.