List logins that have Permissions on SQL Server Mirroring Endpoint

When a mirroring endpoint is created, only members of the sysadmin role and the endpoint owner have connect permissions to the endpoint.

To grant CONNECT on a previously created Mirroring Endpoint in SQL Server run following query:

USE master;
GO
GRANT CONNECT on ENDPOINT::Mirroring_Endpoint_Name TO [domain_name\user_name];
GO

To grant VIEW DEFINITION on a previously created Mirroring Endpoint in SQL Server run following query:

USE master;
GO
GRANT VIEW DEFINITION on ENDPOINT::Mirroring_Endpoint_Name TO [domain_name\user_name];
GO

To list logins that have been granted permissions on SQL Server Mirroring Endpoint, run following query:

SELECT e.name as mirror_endpoint_name, s.name AS login_name
, p.permission_name, p.state_desc as permission_state, e.state_desc endpoint_state
FROM sys.server_permissions p
INNER JOIN sys.endpoints e ON p.major_id = e.endpoint_id
INNER JOIN sys.server_principals s ON p.grantee_principal_id = s.principal_id
WHERE p.class_desc = 'ENDPOINT' AND e.type_desc = 'DATABASE_MIRRORING'

mirror_endpoint_permissions

If the post helped you, please share it:
Pin It

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">