You can use the Terminal Services query command for this.
query session /server:remote_computer_name_here
Note that you will need to set the following registry value on the remote computer:
Key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server
Value Name: AllowRemoteRPC
Value: 1
Type: REG_DWORD
You could put the query command in a batch file, so users can just double click it to see who is logged into that computer.
Answer from Patrick Seymour on Stack ExchangeWay to see who is logged into servers remotely?
remotely Identifying a logged on user using CMD - Software & Applications - Spiceworks Community
Use CMD to return the logged in user of a remote computer - Software & Applications - Spiceworks Community
determine what user is logged in remotely (command line) - TechRepublic
Videos
You can use the Terminal Services query command for this.
query session /server:remote_computer_name_here
Note that you will need to set the following registry value on the remote computer:
Key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server
Value Name: AllowRemoteRPC
Value: 1
Type: REG_DWORD
You could put the query command in a batch file, so users can just double click it to see who is logged into that computer.
You could use the Windows Sysinternals tool PSLoggedOn.
Usage: psloggedon [- ] [-l] [-x] [\\computername | username]
- Displays the supported options and the units of measurement used for output values.
-l Shows only local logons instead of both local and network resource logons.
-x Don't show logon times.
\\computername Specifies the name of the computer for which to list logon information.
username If you specify a user name PsLoggedOn searches the network for computers to which that user is logged on. This is useful if you want to ensure that a particular user is not logged on when you are about to change their user profile configuration.
Hello, Jr Jr Sysadmin Jr here, my supervisor and I are constantly running into a problem where we bump each other off servers with RDP. We only have a few, and 2 or 3 that we are on regularly. I suggested we just text each other, but he did not like that idea. Is there an app or command line that would enable me, within a few clicks, to see if someone is currently logged into a server? Thank you.
You can use the commands listed here to manage Terminal Server connections. query session /server:<servername> is probably the first one you want.
These all require remote procedure call, which is part and parcel with CIFS/SMB (the IPC$ share). Check that the RPC service is enabled first. Second, you can't/shouldn't (depending on network configuration) run these services over anything but the local network. If you're trying to do this sort of management over the Internet, you should be using a VPN or some creative SSH tunneling.
Use the eventvwr to remotely view the security log for the remote computer, and scroll through the security logs until you find a login event for the other user:
eventvwr [remote computer name without brackets]