Skip to content

Latest commit

 

History

History
76 lines (51 loc) · 4.24 KB

File metadata and controls

76 lines (51 loc) · 4.24 KB
title Powershell: Availability group database mirroring endpoint
description Describes how to create a database mirroring endpoint for an Always On availability group using PowerShell.
ms.custom seo-lt-2019
ms.date 05/17/2016
ms.prod sql
ms.reviewer
ms.technology high-availability
ms.topic conceptual
helpviewer_keywords
Availability Groups [SQL Server], server instance
Availability Groups [SQL Server], deploying
Availability Groups [SQL Server], endpoint
ms.assetid 6197bbe7-67d4-446d-ba5f-cabfa5df77f1
author MashaMSFT
ms.author mathoma

Create a database mirroring endpoint for an availability group using PowerShell

[!INCLUDEappliesto-ss-xxxx-xxxx-xxx-md]

This topic describes how to create a database mirroring endpoint for use by [!INCLUDEssHADR] in [!INCLUDEssCurrent] by using PowerShell.

Permissions

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

Important

The RC4 algorithm is deprecated. [!INCLUDEssNoteDepFutureDontUse] We recommend that you use AES.

Using PowerShell

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.

Example (PowerShell)

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

Important

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"  
  

Related Tasks

To Configure a Database Mirroring Endpoint

To View Information About the Database Mirroring Endpoint

See Also

Create an Availability Group (Transact-SQL)
Overview of Always On Availability Groups (SQL Server)