use sql named instance in a powershell script

Welcome Forums General PowerShell Q&A use sql named instance in a powershell script

Viewing 2 reply threads
  • Author
    Posts
    • #251465
      Participant
      Topics: 2
      Replies: 4
      Points: 29
      Rank: Member

      Hi

       

      I am trying to use:

       

      Set-SqlAvailabilityReplica -AvailabilityMode “SynchronousCommit” -FailoverMode “Manual” ` -Path “SQLSERVER:\SQL\xxx\DEFAULT\AvailabilityGroups\xxx\AvailabilityReplicas\”

       

      With an instance name meaning at the end sqlserver\instancename

       

      Every attempt to put quotes, or encode the value or create a variable wont work

       

      Anyone can help me find out how i can do this?

       

      With a sql server no instance it works

       

      Thanks

    • #251612
      Participant
      Topics: 16
      Replies: 1792
      Points: 3,290
      Helping Hand
      Rank: Community Hero

      Take a look at this:

      A Month of SQLPS: Managing Availability Group Replicas

      Note the path we use, not to be confused with the path of the SQL Server instance. This path should be within the context of the primary node for the AG. Running this command will create the replica.

    • #253202
      Participant
      Topics: 2
      Replies: 4
      Points: 29
      Rank: Member

      Take a look at this:

      A Month of SQLPS: Managing Availability Group Replicas

      <iframe width=”600″ height=”264″ class=”wp-embedded-content” sandbox=”allow-scripts” security=”restricted” title=”“A Month of SQLPS: Managing Availability Group Replicas” — Art of the DBA” src=”https://www.mikefal.net/2015/10/20/a-month-of-sqlps-managing-availability-group-replicas/embed/#?secret=lPGncFHb4l&#8221; data-secret=”lPGncFHb4l” frameborder=”0″ marginwidth=”0″ marginheight=”0″ scrolling=”no” data-mce-fragment=”1″></iframe>

      Note the path we use, not to be confused with the path of the SQL Server instance. This path should be within the context of the primary node for the AG. Running this command will create the replica.

      Thanks. it guided me to the right place

Viewing 2 reply threads
  • You must be logged in to reply to this topic.