Get Secondary replica name in a variable

  • 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?

     

    Thanks

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

    Sue

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

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