Is there a tool or script or some other way of knowing what computer name a specific user is currently logged on to? Or even was logged on to?
Say the user "HRDrone" is working on his machine whose hostname is "HRStation01".
I, sitting at my sysadmin desk, only know that the username is "HRDrone". Any way i can find out that he is logged on to "HRStation01" without asking the user? AD event viewer? anything?
Thanks!
There is a great Sysinternals utility that will do just this for you - PsLoggedOn
A cheap trick I often use is to look at the the "Sessions" listed under "Shared Folders" in the "Computer Management" console targeted at a file server computer where I know the subject user will have a "drive" "mapped".
how about these in bat file as a user logon script Run it and you will see the fun
OR if you need in detail
you can contact me for more scripts if you need it, its good learning for me aswell
I'm not sure there is something live, but the Security Event Log records logins from users. Accessing the Event log on the DCs should be able to give you this information. That is provided that information is being collected. I think that is a policy setting.
This page from Microsoft describes a really slow and complicated way to query the event logs: http://technet.microsoft.com/en-us/library/ee176699.aspx
I'm pretty sure this won't help you, but it might work as an audit. I.e who was logged in when the bad stuff happened!
As a sysadmin, you could embed a routine in your logon script to store a .
txt
file with the username and hostname in it, or use sqlite.I had to solve this problem for doing remote support throughout my company. Things like PsLoggedOn, and tools to scan the domain controller's security logs proved to be far too slow for my purposes (getting the hostname to do remote support for users). Here's what I came up with:
This script records what computer they logged into in their home folder. It specifically doesn't record them logging into our terminal server, because I don't care about such entries.
Then I use a bit of VBscript on my local machine to automatically find their home directory in AD, open the log file, and print out the last few lines.