Creating and enabling the HADR endpoint

In this recipe, we will create and enable the AlwaysOn endpoint for all the nodes.

Getting ready

For this recipe, we will use port 5022 for the AlwaysOn communication for all the nodes. To ensure that this works, an exception in the firewall needs to be created for this port for all the instances. If you are using an isolated development environment, you need to first turn off the firewall to get this recipe to work, without having to tinker with the firewall.

We are also going to execute the code on all the nodes. For the following recipe to work, PSRemoting needs to be turned on in every node. Log in to each of the nodes, launch PowerShell or PowerShell ISE as an administrator, and enable remoting using the ...

Get SQL Server 2014 with PowerShell v5 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.