#PSTip Creating a SQL TCP mirroring endpoint with SMO and PowerShell

In today’s tip, we will see how we can use PowerShell and SMO to create a SQL TCP mirroring endpoint. We can use the Create() method of Microsoft.SqlServer.Management.Smo.Endpoint class to create an endpoint. In the following function, I used the code we published in earlier tips to verify whether an endpoint exists or not. So, to be able to use this function, you need the Get-SQLEndpoint function from an earlier tip.

Like this:

About the author: Ravikanth C

Ravikanth is the founder and editor of the PowerShell Magazine. He is also a PowerShell MVP who works at Dell Inc. He blogs at http://www.ravichaganti.com/blog and you can follow him on Twitter @ravikanth.