Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Create a Database Mirroring Endpoint for AlwaysOn Availability Groups (SQL Server PowerShell)

Create a Database Mirroring Endpoint for AlwaysOn Availability Groups (SQL Server PowerShell)

 

This topic describes how to create a database mirroring endpoint for use by AlwaysOn Availability Groups in SQL Server 2016 by using PowerShell.

In This Topic

System_CAPS_security Security Note

The RC4 algorithm is deprecated. This feature will be removed in a future version of Microsoft SQL Server. Do not use this feature in new development work, and modify applications that currently use this feature as soon as possible. We recommend that you use AES.

Requires CREATE ENDPOINT permission, or membership in the sysadmin fixed server role. For more information, see GRANT Endpoint Permissions (Transact-SQL).

Arrow icon used with Back to Top link

To create a database mirroring endpoint

  1. Change directory (cd) to the server instance for which you want to create the database mirroring endpoint.

  2. Use the New-SqlHadrEndpoint cmdlet to create the endpoint and then use the Set-SqlHadrEndpoint to start the endpoint.

The following PowerShell commands create a database mirroring endpoint on an instance of SQL Server (Machine\Instance). The endpoint uses port 5022.

System_CAPS_importantImportant

This example works only on a server instance that currently lack a database mirroring endpoint.

# Create the endpoint.
$endpoint = New-SqlHadrEndpoint MyMirroringEndpoint -Port 5022 -Path SQLSERVER:\SQL\Machine\Instance

# Start the endpoint
Set-SqlHadrEndpoint -InputObject $endpoint -State "Started"

Arrow icon used with Back to Top link

Community Additions

ADD
Show:
© 2015 Microsoft