T-SQL query to Get Details of AlwaysOn HighAvailability Groups AvailabilityGroup Listeners

Here is a T-SQL query to Get Details of AlwaysOn HighAvailability Groups AvailabilityGroup Listeners

select * into #myTempag_availability_groups from master.sys.availability_groups
SELECT
AGL.dns_name AS [Name],
'Server[@Name=' + quotename(CAST(
        serverproperty(N'Servername')
       AS sysname),'''') + ']' + '/AvailabilityGroup[@Name=' + quotename(AG.name,'''') + ']' + '/AvailabilityGroupListener[@Name=' + quotename(AGL.dns_name,'''') + ']' AS [Urn],
ISNULL(AGL.port, -1) AS [PortNumber],
AGL.is_conformant AS [IsConformant],
ISNULL(AGL.ip_configuration_string_from_cluster, N'') AS [ClusterIPConfiguration]
FROM
#myTempag_availability_groups AS AG
INNER JOIN master.sys.availability_group_listeners AS AGL ON AGL.group_id=AG.group_id
WHERE
(AG.name='YourAvailabilityGroupName')
ORDER BY
[Name] ASC
drop table #myTempag_availability_groups