Get-DbaEndpoint
View SourceSynopsis
Retrieves SQL Server endpoints with network connectivity details for troubleshooting and documentation.
Description
Retrieves all SQL Server endpoints including DatabaseMirroring, ServiceBroker, Soap, and TSql types with their network configuration details. This function provides essential information for troubleshooting connectivity issues, documenting high availability setups, and performing security audits. It automatically resolves DNS names and constructs connection strings (FQDN format) for endpoints that have TCP listeners, making it easier to validate network accessibility and plan firewall configurations.
Syntax
Get-DbaEndpoint
[-SqlInstance] <DbaInstanceParameter[]>
[[-SqlCredential] <PSCredential>]
[[-Endpoint] <String[]>]
[[-Type] <String[]>]
[-EnableException]
[<CommonParameters>]
Examples
Example: 1
PS C:\> Get-DbaEndpoint -SqlInstance localhost
Returns all endpoints on the local default SQL Server instance
Example: 2
PS C:\> Get-DbaEndpoint -SqlInstance localhost, sql2016
Returns all endpoints for the local and sql2016 SQL Server instances
Required Parameters
-SqlInstance
The target SQL Server instance or instances.
| Property | Value |
|---|---|
| Alias | |
| Required | True |
| Pipeline | true (ByValue) |
| Default Value |
Optional Parameters
-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.
| Property | Value |
|---|---|
| Alias | |
| Required | False |
| Pipeline | false |
| Default Value |
-Endpoint
Specifies one or more endpoint names to retrieve instead of returning all endpoints. Accepts exact endpoint names and supports multiple values.
Use this when you need to examine specific endpoints like ‘Mirroring’ or ‘AlwaysOn_health’ rather than scanning all configured endpoints.
| Property | Value |
|---|---|
| Alias | |
| Required | False |
| Pipeline | false |
| Default Value |
-Type
Filters endpoints by their functional type. Valid options: DatabaseMirroring, ServiceBroker, Soap, and TSql.
Use this to focus on specific endpoint categories, such as ‘DatabaseMirroring’ for Always On AG troubleshooting or ‘ServiceBroker’ for message queuing configurations.
| Property | Value |
|---|---|
| Alias | |
| Required | False |
| Pipeline | false |
| Default Value | |
| Accepted Values | DatabaseMirroring,ServiceBroker,Soap,TSql |
-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.
| Property | Value |
|---|---|
| Alias | |
| Required | False |
| Pipeline | false |
| Default Value | False |
Outputs
Microsoft.SqlServer.Management.Smo.Endpoint
Returns one Endpoint object per endpoint found on the SQL Server instance, with custom properties added for connection details and network information.
Default display properties (via Select-DefaultView):
- ComputerName: The computer name of the SQL Server instance
- InstanceName: The SQL Server instance name (service name)
- SqlInstance: The fully qualified SQL Server instance name (Computer\Instance)
- ID: The unique identifier of the endpoint
- Name: The name of the endpoint
- IPAddress: The IP address the endpoint listens on (when TCP is configured; otherwise null)
- Port: The TCP port the endpoint listens on (when TCP is configured; otherwise null)
- EndpointState: The current state of the endpoint (Started or Stopped)
- EndpointType: The type of endpoint (DatabaseMirroring, ServiceBroker, Soap, or TSql)
- Owner: The SQL Server login that owns the endpoint
- IsAdminEndpoint: Boolean indicating if this is an administrative endpoint
- Fqdn: Fully qualified domain name and port in connection string format (TCP://hostname:port) for endpoints with TCP listeners; null for endpoints without TCP configuration
- IsSystemObject: Boolean indicating if this is a system-created endpoint
Additional properties available (from SMO Endpoint object):
- CreateDate: The date and time when the endpoint was created
- DateLastModified: The date and time when the endpoint was last modified
- Payload: Protocol-specific configuration details for the endpoint
- Protocol: Protocol configuration details (includes Tcp, NamedPipes, SharedMemory configuration objects)
- ProtocolName: The name of the protocol used Note: The IPAddress, Port, and Fqdn properties are custom-added by this function to enhance output. When an endpoint has TCP listeners configured, these properties are populated; otherwise, they are null or empty. The Fqdn property is automatically resolved with DNS lookups to provide a fully qualified domain name for connectivity testing.
dbatools