commands

^

Test-DbaEndpoint

Author Chrissy LeMaire (@cl), netnerds.net
Availability Windows, Linux, macOS

 

Want to see the source code for this command? Check out Test-DbaEndpoint on GitHub.
Want to see the Bill Of Health for this command? Check out Test-DbaEndpoint.

Synopsis

Performs a simple connectivity test for TCP and SSL enabled endpoints.

Description

Performs a simple connectivity test for TCP and SSL enabled endpoints. Tests if port is accessible, not if endpoint is working.

Note that if an endpoint does not have a tcp listener port, it will be skipped.

Syntax

Test-DbaEndpoint
    [[-SqlInstance] <DbaInstanceParameter[]>]
    [[-SqlCredential] <PSCredential>]
    [[-Endpoint] <String[]>]
    [[-InputObject] <Endpoint[]>]
    [-EnableException]
    [<CommonParameters>]

 

Examples

 

Example: 1
PS C:\> Test-DbaEndpoint -SqlInstance localhost

Tests all endpoints on the local default SQL Server instance.
Note that if an endpoint does not have a tcp listener port, it will be skipped.

Example: 2
PS C:\> Get-DbaEndpoint -SqlInstance localhost, sql2016 -Endpoint Mirror | Test-DbaEndpoint

Tests all endpoints named Mirroring on sql2016 and localhost.
Note that if an endpoint does not have a tcp listener port, it will be skipped.

Example: 3
PS C:\> Test-DbaEndpoint -SqlInstance localhost, sql2016 -Endpoint Mirror

Tests all endpoints named Mirroring on sql2016 and localhost.
Note that if an endpoint does not have a tcp listener port, it will be skipped.

Example: 4
PS C:\> Test-DbaEndpoint -SqlInstance localhost -Verbose

Tests all endpoints on the local default SQL Server instance.
See all endpoints that were skipped due to not having a tcp listener port.

Optional Parameters

-SqlInstance

The target SQL Server instance or instances.

Alias
Required False
Pipeline false
Default Value
-SqlCredential

Login to the target instance using alternative credentials. Accepts PowerShell credentials (Get-Credential).
Windows Authentication, SQL Server Authentication, Active Directory - Password, and Active Directory - Integrated are all supported.
For MFA support, please use Connect-DbaInstance.

Alias
Required False
Pipeline false
Default Value
-Endpoint

Test only specific endpoint or endpoints.

Alias
Required False
Pipeline false
Default Value
-InputObject

Enables piping from Get-DbaEndpoint.

Alias
Required False
Pipeline true (ByValue)
Default Value
-EnableException

By default, when something goes wrong we try to catch it, interpret it and give you a friendly warning message.
This avoids overwhelming you with "sea of red" exceptions, but is inconvenient because it basically disables advanced scripting.
Using this switch turns this "nice by default" feature off and enables you to catch exceptions with your own try/catch.

Alias
Required False
Pipeline false
Default Value False