Link to home
Start Free TrialLog in
Avatar of itbabe
itbabe

asked on

How can I check which activedirectory user is logged on on a remote machine ?

Please advise
Avatar of Chris Dent
Chris Dent
Flag of United Kingdom of Great Britain and Northern Ireland image

The simplest possible way is to get WMI to tell you. Interactive users only.
(Get-CimInstance Win32_ComputerSystem -ComputerName some-remote-pc).Username

Open in new window

If you want a more detailed approach

https://gallery.technet.microsoft.com/scriptcenter/Get-LastLogon-Determining-283f98ae

I've used that myself on 1000 VM desktops.
Lazy man's way to track user logon/logoff
I always like to find easy ways to do things.

Step 1: Create the following two files using Notepad or your favorite text editor:

------logon.cmd----
echo logon %username% %computername% %date% %time% >> \\SERVER\share\logon.log

-----logoff.cmd-----
echo logoff %username% %computername% %date% %time% >> \\SERVER\share\logon.log

Step 2: Update Group Policy to run the appropriate batch file. In Group Policy, go to:
User Configuration-> Windows Settings-> Scripts (Logon/Logoff)-> Logon

This will tell you about every users logon and logoff
Tom,

You need to cite sources when you do what you've just done. It's a fine way to get yourself in trouble with the site moderators.

http://blogs.msmvps.com/kwsupport/2005/02/24/lazy-mans-way-to-track-user-logonlogoff/

It's not your work, you should not pass it off as your work.
@Chriss
I have this in my Outlook notes for Years. I've used this solution 7 years ago. I did not copied this today from any website.
I did not know that this exists in internet
Avatar of itbabe
itbabe

ASKER

I am not sure these tips wil provide me a view on who is currently logged on (if I don't know who its is)
If you will see Username with log on time and there is no Log Off time it seem he is still log on
ASKER CERTIFIED SOLUTION
Avatar of Chris Dent
Chris Dent
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
You could check the logon information in event log. Check Event viewer -->> Security events for Successfully logins. You can filter by user or Computer name to find exact time and that of logged in user.

Get in detail here to track user logon sessions using event log:
https://community.spiceworks.com/how_to/130398-how-to-track-user-logon-sessions-using-event-log

Try this:

Right click My Computer - Click Manage - Expand Shared Folders - Click Sessions

This will provide the username and the IP of the PC they are logged into

You can then go to DHCP under Administrative Tools and view the leases to see the PC name

https://social.technet.microsoft.com/Forums/windows/en-US/01eaf9dd-ac07-45bc-8d01-9fc85ba9db9f/find-computer-name-user-is-logged-onto?forum=winserverDS

https://deployhappiness.com/find-out-what-computer-a-user-logged-into/

https://social.technet.microsoft.com/Forums/office/en-US/2b6c1df1-7fdc-4e1a-9ef2-163ebc035aed/report-all-computers-and-last-logged-on-user-to-those-computers-from-active-directory?forum=winserverDS

Hope this helps!
Is there any update?