is there a way to see which users are logged into which computers?

joypatrick used Ask the Experts™
I don't want to log into each PC to see which user is already logged in.  I just want to see if say user A is logged into computer 2.
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
IT Engineer
Distinguished Expert 2017
3 Ways to Remotely View Who Is Logged On
1. You can use Remote Desktop Services Manager from RSAT package
2. You can ask in command prompt using PsLoggedOn from sysinternals package ( C:\PsTools\psloggedon.exe \\server-a)
3. Or you can use Query located at %SystemRoot%\system32\query.exe on your command prompt
query user /server:server-a
Lawrence TsePrinciple Consultant

Oh sorry wrong threat
Lawrence TsePrinciple Consultant
Found this VBScript might help:

strComputer = "."   ' " use "." for local computer


Set objWMI = GetObject("winmgmts:" _
              & "{impersonationLevel=impersonate}!\\" _
              & strComputer & "\root\cimv2")

Set colSessions = objWMI.ExecQuery _
    ("Select * from Win32_LogonSession Where LogonType = 2 OR LogonType = 10")

If colSessions.Count = 0 Then
   Wscript.Echo "No interactive users found"
   For Each objSession in colSessions
     If objSession.LogonType = 2 Then
       WScript.Echo "Logon type: Console"
       WScript.Echo "Logon type: RDP/Terminal Server"
     End If
     Set colList = objWMI.ExecQuery("Associators of " _
         & "{Win32_LogonSession.LogonId=" & objSession.LogonId & "} " _
         & "Where AssocClass=Win32_LoggedOnUser Role=Dependent" )

     For Each objItem in colList
       WScript.Echo "User: " & objItem.Name
       WScript.Echo "FullName: " & objItem.FullName
       WScript.Echo "Domain: " & objItem.Domain
     Wscript.Echo "Session start time: " & objSession.StartTime
End If
Tom CieslikIT Engineer
Distinguished Expert 2017

Best solution provided, no more other questions from author

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial