February 15, 2002 at 9:52 am
Hello All,
I was wondering if there is a way to find out when the last time was that a person logged on to SQL Server.
Basically, I am taking over DBA duties and there are quite a few users on the system that I believe have left the company. I would like to get find all of the users that haven't logged on for a certain amount of time.
Thank you for your time,
Chuck Maracle
February 15, 2002 at 10:25 am
Not that I know of. I think if you want to know this, you will need to build something to track it.
Steve Jones
February 15, 2002 at 10:45 am
I looked at all the sys tables. There is no last login that I can find. I would suggest an outside app, or trigger or so kind of internal job to monitor.
February 15, 2002 at 11:48 am
Are the user accounts SQL Server based on Windows based? If they are Windows based, there are some things that can be done to find out the last time a user logged into the domain.
K. Brian Kelley
http://www.sqlservercentral.com/columnists/bkelley/
K. Brian Kelley
@kbriankelley
February 15, 2002 at 3:10 pm
Yes they are from NT.
I guess the major question is: aside from the admin (read developer) accounts, could I cause any problems with just dropping these accounts. We now have everyone in a groups on NT, and they get access though those. No one else should have created anything, but even if they did what would happen if I dropped the account.
Again thank you for your time,
Chuck
February 15, 2002 at 3:42 pm
February 15, 2002 at 5:30 pm
I don't think that is the case if you drop an account in NT. Also I believe if these are NT accounts you can turn auditing on to see when they login.
February 16, 2002 at 10:03 am
Auditing can be turned on for both SQL Server 7 and 2000 for NT users. Results will show up in the Security Log on the system. However, if you suspect certain users haven't logged in for a while, period (for instance, the domain), you can take advantage of the net user command from the command prompt. For instance, I have a user jsmith, who I want to know how long it's been since he's logged on. From a command prompt I can enter:
net user jsmith /domain
In the user profile that will be returned, I'll be able to see when the last time the user logged into the domain.
K. Brian Kelley
http://www.sqlservercentral.com/columnists/bkelley/
K. Brian Kelley
@kbriankelley
February 16, 2002 at 8:10 pm
That's usefull, I'll give that to my bud who gets stuck with all the account resposibilities.
February 17, 2002 at 3:22 pm
Thanks for all of the help. The netuser should work out fine.
Thanks again.
Chuck
Viewing 10 posts - 1 through 9 (of 9 total)
You must be logged in to reply to this topic. Login to reply