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 database in an Availability Group(s).

Information returned on the database will be specific to that replica, whether it is primary or a secondary.

This command will return an SMO object, but it is the AvailabilityDatabases object and not the Server.Databases object.




Returns basic information on the listener found on sqlserver2014a.

Get-DbaAgListener -SqlInstance sqlserver2014a

Returns basic information on the listener found on sqlserver2014a in the Availability Group AG-a.

Get-DbaAgListener -SqlInstance sqlserver2014a -AvailabilityGroup AG-a


This command was created by Viorel Ciucu. You can find Viorel on his blog.


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

Source Code

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

Related commands