SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Cannot drop mapped windows login from SQL Server due to ENDPOINT permission


Cannot drop mapped windows login from SQL Server due to ENDPOINT permission

Author
Message
web1701
web1701
SSC-Enthusiastic
SSC-Enthusiastic (160 reputation)SSC-Enthusiastic (160 reputation)SSC-Enthusiastic (160 reputation)SSC-Enthusiastic (160 reputation)SSC-Enthusiastic (160 reputation)SSC-Enthusiastic (160 reputation)SSC-Enthusiastic (160 reputation)SSC-Enthusiastic (160 reputation)

Group: General Forum Members
Points: 160 Visits: 97
Trying to do some housekeeping of our SQL logins and I noticed that my active directory account has a mapped login on our SQL server. I am also granted 'sysadmin' access to the SQL server by way of a mapped group also so I would like to drop my individual login. I am having trouble dropping it and am getting the following error:

Msg 15173, Level 16, State 1, Line 2
Login 'abc\abc123' has granted one or more permission(s). Revoke the permission(s) before dropping the login.


After doing some digging around on the web and some looking around the server I ran these queries (my login's principal id is 306)


Select * from sys.server_permissions
where grantor_principal_id = (Select principal_id from sys.server_principals where name = N'abc\abc123')

SELECT * FROM sys.[database_mirroring_endpoints]



Results:

class class_desc major_id minor_id grantee_principal_id grantor_principal_id type permission_name state state_desc
----- ------------------------------------------------------------ ----------- ----------- -------------------- -------------------- ---- -------------------------------------------------------------------------------------------------------------------------------- ----- ------------------------------------------------------------
105 ENDPOINT 65536 0 307 306 CO CONNECT G GRANT

name endpoint_id principal_id protocol protocol_desc type type_desc state state_desc is_admin_endpoint role role_desc is_encryption_enabled connection_auth connection_auth_desc certificate_id encryption_algorithm encryption_algorithm_desc
-------------------------------------------------------------------------------------------------------------------------------- ----------- ------------ -------- ------------------------------------------------------------ ---- ------------------------------------------------------------ ----- ------------------------------------------------------------ ----------------- ---- ------------------------------------------------------------ --------------------- --------------- ------------------------------------------------------------ -------------- -------------------- ------------------------------------------------------------
Mirroring 65536 306 2 TCP 4 DATABASE_MIRRORING 0 STARTED 0 1 PARTNER 1 3 NEGOTIATE 0 1 RC4


We are not using Database Mirroring on this server although it might a remnant of us testing out stuff before it went into production.
I attempted to revoke the permissions by executing this query:

REVOKE CONNECT ON ENDPOINT::Mirroring FROM [abc\abc123]



Results:
Cannot grant, deny, or revoke permissions to sa, dbo, entity owner, information_schema, sys, or yourself.

I also tried to run this as another login that has 'sysadmin' to no avail. Any ideas? Am I on the right track?
DBA From The Cold
DBA From The Cold
Hall of Fame
Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)

Group: General Forum Members
Points: 3455 Visits: 1757
Hi,

If the endpoint is no longer required (and you are sure), have you tried dropping it?

DROP ENDPOINT <endpoint name>

Andrew
web1701
web1701
SSC-Enthusiastic
SSC-Enthusiastic (160 reputation)SSC-Enthusiastic (160 reputation)SSC-Enthusiastic (160 reputation)SSC-Enthusiastic (160 reputation)SSC-Enthusiastic (160 reputation)SSC-Enthusiastic (160 reputation)SSC-Enthusiastic (160 reputation)SSC-Enthusiastic (160 reputation)

Group: General Forum Members
Points: 160 Visits: 97
After dropping the endpoint I was then able to remove the mapped login. I was so focused on those errors I didn't even think to go drop the endpoint.

Thanks Andrew!
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search