How To Test SQL Connection If No Additional Software Can Be Installed

How can I verify that the SQL Server is reachable from the Orchestrator Server using the same credentials that Orchestrator uses, especially when no additional software can be installed on the server?

Issue Description

In environments where installing additional software on the Orchestrator Server is not permitted, SQL Server connectivity can still be verified using built-in methods. These methods ensure that the server’s connection to the SQL database can be tested using the credentials configured for Orchestrator.

Resolution

Using a UDL (Universal Data Link) File

  1. Open File Explorer.
  2. Go to the View tab and ensure that File name extensions are enabled.
  3. Create a blank text document on the desktop and rename it to testdoc.udl.
  4. Double-click the testdoc.udl file to open the Data Link Properties window.
  5. In the Connection tab, enter the SQL Server name and the credentials used by the Orchestrator to connect.
  6. Click Test Connection to verify if the SQL Server is reachable.


Using a script in PowerShell

It is possible to execute the following PowerShell script on the Orchestrator Server:

$connectionString =

"Data Source=SERVERNAME;Initial Catalog=DATABASENAME;User ID=YOUR_USERNAME;Password=YOUR_PASSWORD"
 $connection = New-Object System.Data.SqlClient.SqlConnection
$connection.ConnectionString = $connectionString 
try {
    $connection.Open()
    Write-Host "Success! Connected to the
database successfully!"
} catch {
    Write-Host "Error! Failed to open the
connection..."
    Write-Host $_
} finally {
    $connection.Close()
}

Replace SERVERNAME, DATABASENAME, USER ID and PASSWORD with the actual values. Run the script to test the connection.