I needed to limit access to Sql Mgt Studio for certain users. I found the article above that creates a trigger to prevent making connections for specified users.
CREATE TRIGGER [SQLGP_Logon_trigger_sql_tools] ON ALL SERVER FOR LOGON AS BEGIN IF ORIGINAL_LOGIN() not in ('domain\Administrator', 'sa', 'domain\user1', 'domain\user2', 'domain\user3') AND (program_name() like 'Microsoft SQL Server Management Studio' or program_name() like 'Microsoft SQL Server Management Studio - Query' or program_name() like 'SQL Query Analyzer') ROLLBACK END
As I was playing with the code on our development server I created a trigger that prevents access for all users. I tried using osql to connect but get the error message
Logon failed for login 'someuser' due to trigger execution.
This is similar to the message you get when connecting with Sql Mgt Studio.
Is there a way to force this trigger to disable?