Get Secondary replica name in a variable

  • SQLAddict01

    Say Hey Kid

    Points: 690

    I need to pass secondary replica name in a variable to a command

    for example

    I get the primary replica name using

    Get-DbaAvailabilityGroup -SqlInstance ListenerName| Select-Object * -ExpandProperty PrimaryReplicaServerName

    How do I get the secondary replica name?



  • Sue_H

    SSC Guru

    Points: 90700

    dbatools also has the cmdlet Get-DbaAgReplica that you may want to try.


Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply