We help IT Professionals succeed at work.

Check who is logged into specific IP addresses

I would like to check which user(s) are logged into a specific IP address  (internally) on a Windows network.
How can I achieve this via a script or command line?
Watch Question

IT Services Analyst
query user /server:nameofcomputer

So if they were on a PC called PC123 it would be query user /server:PC123

Or if they IP of that machine was then query user /server:
Distinguished Expert 2019

To have this information handy, you have to proactively collect it.

You can use a user base GPO that runs a login script
echo "On %date% at %time%, %USERNAME% loged into %COMPUTERNAME% on %sessionname% authorized against %LOGONSERVER^" >>\\server\sharename\recordkeeping_file.

Now on your DHCP server, you have to keep a record of which IP was allocated to which system.

The above is a simple example, you can use vbscript, powershell, etc. to record these in a DB.
You can use SNMP to generate login/logout events as well as IP...


Thanks William.