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.
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It only takes a minute to sign up.
Sign up to join this communityI 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.
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