Re: Disable or prevent Trusted Connection (-E) logins [DDL triggers]

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



You could create a login trigger like this one:

CREATE TRIGGER LimitLogins
ON ALL SERVER
FOR LOGON
AS
BEGIN;
DECLARE @TrustedConnection INT
IF EXISTS (SELECT *
FROM sys.server_principals
WHERE name = SUSER_SNAME() AND type <> 's')
SET @TrustedConnection = 1
ELSE
SET @TrustedConnection = 0
IF IS_SRVROLEMEMBER ('sysadmin') = 0 AND
IS_MEMBER ('webadmins') = 0 AND
@TrustedConnection = 0
ROLLBACK;
END;

This would require you to create a role in master for webadmins and populate it with the trusted connection logins that should be allowed in. Something like this:

USE master
GO
CREATE ROLE webadmins
GO
CREATE LOGIN N'Domain\Login' FROM WINDOWS ...
GO
CREATE USER N'Domain\Login' FOR LOGIN ...
GO
EXEC sp_addrolemember N'webadmins', N'Domain\Login'
GO

Be sure and test a login trigger very carefully, since a mistake can lock you out of the server. (For example, do not close the connection used to create the trigger, so that you can drop it again if it does not work as you (or I) expected.)

FWIW,
RLF

"Uday" <Uday@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:EBA8ED31-F185-44C6-91FA-D68031C9C4A5@xxxxxxxxxxxxxxxx
Guys,

Is it possible to disable or prevent Trusted Connection logins to Sql Server
Express 2005 installed on a laptop for non-admin accounts using DDL triggers?

Also, could I restrict any login attempts, either Windows Authentication or
Sql Server authentication, to only admin and webserver accounts.

Any sample code or link to an article would help a lot.

thanks,
_t

.



Relevant Pages

  • Re: Disable or prevent Trusted Connection (-E) logins [DDL trigger
    ... CREATE TRIGGER LimitLogins ... ON ALL SERVER ... DECLARE @TrustedConnection INT ... CREATE LOGIN N'Domain\Login' FROM WINDOWS ... ...
    (microsoft.public.sqlserver.server)
  • gdm hangs
    ... gdm will hang 9 of 10 times when logging out. ... with or without the client having been connected to the Server. ... # Timed login, useful for kiosks. ... Must output the chosen host on stdout, ...
    (Debian-User)
  • RE: OWA 2003 with ISA 2004
    ... OWA externally. ... i can login by any user. ... 825763 How to configure Internet access in Windows Small Business Server ... g. Reproduce this issue and send the logs to me. ...
    (microsoft.public.windows.server.sbs)
  • Re: Compromised Server? Anyone recognize the suspect Services?
    ... there are a bunch of logins for Website Accounts created by the ... The login accounts are for web sites that are on the ... Server management is ... right under Network Connections there were 3 ...
    (microsoft.public.windows.server.networking)
  • Re: IIS 6.0 FTP
    ... Server port: 21. ... I doubt IIS FTP has such feature. ... next, general 530 error indicating login failed, that could due to ... clients are using an order entry program created in Microsoft access. ...
    (microsoft.public.inetserver.iis.ftp)