1

I have configured the login audit to save only the failed ones, but I need to omit a specific login in said audit, is it possible?

I am using sqlserver 2008-r2

Thanks.

3
  • Please add more details, how did you set it up? Where it is writing? – SqlWorldWide Jun 8 '17 at 13:31
  • in server property --> security --> Failed logins only. write in error log – Max Jun 8 '17 at 13:44
  • Upgrade to a more current version of SQL Server and you can filter logins. ;) – user507 Jun 8 '17 at 15:13
0

You cannot do it there. But you can set up a server audit and exclude specific login. I have not tested the code in 2008 R2. Change you login value with LoginName. You can also use server_principal_id instead of server_principal_name.

USE [master]

GO

CREATE SERVER AUDIT [FailedLogin]
TO FILE 
(   FILEPATH = N'C:\'
    ,MAXSIZE = 64 MB
    ,MAX_FILES = 50
    ,RESERVE_DISK_SPACE = OFF
)
WITH
(   QUEUE_DELAY = 1000
    ,ON_FAILURE = CONTINUE
)
WHERE server_principal_name <> 'LoginName'

GO

USE [master]

GO

CREATE SERVER AUDIT SPECIFICATION [ServerAuditSpecificationFailedLogin]
FOR SERVER AUDIT [FailedLogin]
ADD (FAILED_LOGIN_GROUP)

GO

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.