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 2008 Forums
 SQL Server Administration (2008)
 Auditing Logins

Author  Topic 

rmg1
Constraint Violating Yak Guru

256 Posts

Posted - 2012-06-06 : 07:21:34
Hi all

It's somehow become my task to go through each login on our SQL Server 2008 install to see which accounts can be disabled.
What I'd like to do is find out when users last logged in.

The logins are based on a windows username (so I assume some sort of ActiveDirectory interaction) but I'm struggling.

I've found some code (courtesy of Google) but it's only showing failed logins not successful ones.

Does anyone know if it's even possible to do what I want through script?

nigelrivett
Master Smack Fu Yak Hacker

3385 Posts

Posted - 2012-06-06 : 07:39:19
Right click on server name in management studio. select security tab.
There is an option there to audit all logins - the default is failed only I think.

==========================================
Cursors are useful if you don't know sql.
SSIS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

rmg1
Constraint Violating Yak Guru

256 Posts

Posted - 2012-06-06 : 07:55:28
Thanks for that. It looks like it's only auditing failed logins (looks to be the default).
I'll have to change that to Failed and Successful logins and then wade through the logs.
Go to Top of Page

rmg1
Constraint Violating Yak Guru

256 Posts

Posted - 2012-06-21 : 04:49:06
Hi all

I've made the changes to the server but it's not logging the successful logins.
Will it need a server restart?
Go to Top of Page

rmg1
Constraint Violating Yak Guru

256 Posts

Posted - 2012-06-25 : 02:13:19
OK, bit of an oddity.
We've had a server restart done over the weekend but it's still not recording successful logins.
I've checked and, under security, it's set to record successful and failed logins.

Anyone any ideas on what else needs doing to get this to work?
Go to Top of Page

rmg1
Constraint Violating Yak Guru

256 Posts

Posted - 2012-07-02 : 05:37:00
Anyone?
Please?
Go to Top of Page
   

- Advertisement -