dbatools is a free PowerShell module with over 300 SQL Server administration, best practice and migration commands included.

Please note that documentation and command names may be out of date while we work furiously towards 1.0


Default view provides most common set of properties for information on the Availability Group(s)’ Replica.




Returns basic information on all the Availability Group(s) replica(s) found on sqlserver2014a.

Get-DbaAgReplica -SqlInstance sqlserver2014a

Shows basic information on the replica(s) found on Availability Group AG-a on sqlserver2014a

Get-DbaAgReplica -SqlInstance sqlserver2014a -AvailabilityGroup AG-a

Returns full object properties on all Availability Group(s) replica(s) on sqlserver2014a.

Get-DbaAgReplica -SqlInstance sqlserver2014a | Select *


This command was created by Shawn Melton. You can find Shawn on Twitter and his blog.

This command was created by Chrissy LeMaire. You can find Chrissy on Twitter.


From PowerShell, execute Get-Help Get-DbaAgReplica -Detailed for more information on this function.

Source Code

Want to see the source code? View Get-DbaAgReplica.ps1 on GitHub

Related commands