Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Finding failed logins on SQL 2005

Author  Topic 

craigwg
Posting Yak Master

154 Posts

Posted - 2009-11-02 : 13:07:09
I have a login on my server that is failing at loging. Currently searching resolving that, but my question is about how to set up something that will automatically find repeated login failures and send an alert, after say, 10 failures so we can resolve accordingly.

What would you suggest? A job, a Stored Procedure? SSIS?

Would love to hear any stories or ideas out there.

Craig

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2009-11-02 : 23:06:21
why not set it to lockout after 8 failed logins. that'll make it easy to find
Go to Top of Page

craigwg
Posting Yak Master

154 Posts

Posted - 2009-11-03 : 09:38:36
quote:
Originally posted by russell

why not set it to lockout after 8 failed logins. that'll make it easy to find



That is a good idea, however not practical in this case. The login is used successfully for other uses. I found a cool stored procedure, sp_readerrorlog, and tweaked it a little to give me what I want:


create table #flog (
LogDate datetime,
ProcessInfo nvarchar(10),
Text nvarchar(max))
insert into #flog
EXEC sp_readerrorlog 0, 1, 'Login failed'

select text
from #flog
group by text
having count(text) > 50
Drop table #flog


This gives me something I can build to dynamically check every server in the organization all at once. Super rad, eh?!

Craig Greenwood
Go to Top of Page
   

- Advertisement -