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
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 SQL Server 7 - Login Failed 18456 Errors

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-07-29 : 08:47:29
Jim writes "I've been receiving the following login failed errors the past few days. My question is how do I trace the login attempts back to their origin. The NT 4 Server event logs provide no further detail. I'd like to trace these errors back to their origin so I can correct the problem. The userid in question does not exist on my SQL Server.

Message text is as follows:

SQL Server Alert System: 'Track: Sev. 24 Errors' occurred on \\XYZ

DESCRIPTION: 18456
Login failed for user 'Admin'.

Any assistance you can offer will be greatly appreciated!"

Page47
Master Smack Fu Yak Hacker

2878 Posts

Posted - 2002-07-29 : 10:30:08
You can set up a trace for failed logins.


DECLARE @queue_handle int --queue handle to refer
--to this trace by
DECLARE @column_value int --data column bitmask

--Set the column mask for the data columns to capture
SET @column_value = 67108864|1|33554432|16384|512|128|64|32

--Create a queue.
EXEC xp_trace_addnewqueue 1000,
5,
95,
90,
@column_value,
@queue_handle OUTPUT

--Specify the event classes to trace.
--To look up the names, execute xp_trace_geteventnames.
EXEC xp_trace_seteventclassrequired @queue_handle,
20, 1 --LoginFailed

--Set any filters. (Don't trace the Profiler).
EXEC xp_trace_setappfilter @queue_handle,
NULL,
'SQL Server Profiler%'

EXEC xp_trace_sethostfilter @queue_handle,
'<yourserver>',
NULL

--Configure the queue to write to a table.
EXEC xp_trace_setqueuedestination @queue_handle,
4,
1,
'<yourserver>',
'database.owner.table'

--Start the consumer that actually writes to a file.
EXEC xp_trace_startconsumer @queue_handle

--Display the queue handle. It will be needed
--later to stop the queue.
SELECT @queue_handle

--Save the queue definition.
EXEC xp_trace_savequeuedefinition @queue_handle,
'FailedLogins',
1

--Mark it for autostart
EXEC xp_trace_setqueueautostart 'FailedLogins', 1

 


Jay White
{0}
Go to Top of Page
   

- Advertisement -