• Skip to main content
  • Skip to primary sidebar

Technipages

Tutorials and fixes for smartphone, gadget, and computer problems

  • Topics
    • Android
    • Browsers
    • Gaming
    • Hardware
    • Internet
    • iPhone
    • Linux
    • macOS
    • Office
    • Reviews
    • Software
    • Windows
    • Definitions
  • Product Reviews
  • Downloads
  • About
Windows: Find Who is Logged Into a Computer

Windows: Find Who is Logged Into a Computer

December 22, 2022 by Mitch Bartlett 18 Comments

If you’re wondering how to find out who is currently logged into a Microsoft Windows computer, there are several ways to proceed. Here are a few common methods you can use from a remote computer or logged into the local computer you are querying.

WhoAmI Command

The “whoami” command displays the user you are currently logged in and using in Windows.

  1. Hold down the Windows Key, and press “R” to bring up the Run window.
  2. Type “CMD“, then press “Enter” to open a command prompt.
  3. At the command prompt, type the following then press “Enter“:
    whoami
  4. The computer name or domain followed by the username is displayed.

Query User Command

This command allows you to see all users currently logged into the computer.

Locally

  1. Hold down the Windows Key, and press “R” to bring up the Run window.
  2. Type “CMD“, then press “Enter” to open a command prompt.
  3. At the command prompt, type the following then press “Enter“:
    query user
  4. The computer name or domain followed by the username is displayed.

Remotely

  1. Hold down the Windows Key, and press “R” to bring up the Run window.
  2. Type “CMD“, then press “Enter” to open a command prompt.
  3. At the command prompt, type the following then press “Enter“:
    query user /server:computername
    Replace “computername” with the actual computer name of the system you are querying. You can also use the IP Address of the computer.
  4. The computer name or domain followed by the username is displayed.

Task Manager

  1. Right-click the taskbar, then select “Task Manager“.
  2. Select the “Users” tab.
  3. Details on the users logged into the machine are displayed.

WMIC

  1. Hold down the Windows Key, and press “R” to bring up the Run window.
  2. Type “CMD“, then press “Enter” to open a command prompt.
  3. At the command prompt, type the following then press “Enter“:
    WMIC /NODE:"computername" COMPUTERSYSTEM GET USERNAME
    Replace “computername” with the actual computer name of the system you are querying. You can also replace “computername” with the IP address of the system.
    WMIC /NODE:192.168.1.1 COMPUTERSYSTEM GET USERNAME

You Might Also Like

  • How to Find Out Which CPU I Have in My Computer (Windows)
    How to Find Out Which CPU I Have in My Computer (Windows)
  • Windows: "User username (SessionId=2) could not be logged off. Access is denied." Fix
    Windows: "User username (SessionId=2) could not be logged…
  • How to Find Computer Locking Active Directory Account
    How to Find Computer Locking Active Directory Account
  • Fix: LastPass Not Staying Logged In
    Fix: LastPass Not Staying Logged In
  • Windows 11: How to Rename Your Computer
    Windows 11: How to Rename Your Computer
  • Fix Zoom Crashes Windows 10 Computer
    Fix Zoom Crashes Windows 10 Computer

Filed Under: Windows

Reader Interactions

Comments

  1. Jennifer says

    April 10, 2022 at 3:17 am

    ‘query’ is not recognized as an internal or external command,
    operable program or batch file.

  2. Raphael Ferreira says

    February 21, 2021 at 3:02 pm

    Plain, simple, and it works. At least in my case. I used the “query user /server:computername” method, as I needed to know who was logged in to a remote machine name I did not recognize… Then when seeing the username I knew who it was (in this case who the computer belonged to). THANKS! Great tip! R.

  3. Tom says

    February 9, 2021 at 6:03 pm

    “At the command prompt, type the following then press “Enter“:
    query user /server:computername
    Replace “computername” with the actual computer name of the system you are querying.”

    I got: The RPC server is unavailable.

    This did not work for me, but exchanging “computername” with the machine’s IP worked just fine.

  4. idan says

    January 27, 2020 at 6:51 am

    This way only gives you one user ,
    but what if i got more users logged on ?

  5. mveras says

    January 16, 2020 at 9:51 am

    One important distinction that needs to be made here is that the “whoami” command does not return who is logged in. It returns who is running the “whoami” command. Which means that if you are running this command as a different user than whoever is actually logged in (like when you are executing remotely, it is completely useless.

    “query user” on the other hand, returns who is actually logged in regardless who is running the “query user”

    The WMIC command lacks one nice feature that “query user” has: the time the user logged in.

  6. Harry S. Anchan says

    November 28, 2019 at 4:52 pm

    Another easy way that i use. Just right-click on the Task bar or C-A-D, bring up Task Manager and click on the Users tab.

  7. eK says

    October 18, 2019 at 12:37 am

    Worked for me, thank you!

  8. samiuddin says

    September 19, 2019 at 2:41 am

    Great contribution! it helped alot

  9. Phil says

    August 12, 2019 at 11:25 pm

    I tried this and both the remote query and WMIC methods returned the error below in my domain…
    I am guessing this is a windows firewall issue ?

    The RPC server is unavailable.

    Regards, Phil

  10. Jvonne says

    July 9, 2019 at 4:00 am

    Thank you much! Like Noel, other cmds like ‘wmic.exe’ and ‘netsh’ and ‘net user’ would not work for remote PC’s on the network, but the ‘query user’ command worked great for me!

  11. Mohammed Saeed says

    May 17, 2019 at 3:15 pm

    It was very handy. saved my day. Thank you very much,

  12. Jeroen says

    September 10, 2018 at 4:05 am

    yes, very usefull,

    I’m wondering (maybe it will go to far) but is there a way to logout some users, like if you’re going to do an update or so.

    thanks

  13. Noel says

    July 30, 2018 at 9:22 am

    Yes, this did help, and it worked on a Windows 10 PC’s on a domain. Other suggestions by other people such as ‘wmic.exe’ and ‘netsh’ and ‘net user’ would not work for remote PC’s on the network, but the ‘query user’ command worked great for me, thanks a lot.

  14. steelersc says

    July 2, 2018 at 4:04 pm

    Worked well when run against windows server

  15. Tony says

    June 12, 2018 at 8:14 am

    A very helpful page, thank you

  16. Mark says

    August 2, 2017 at 8:22 am

    Tom, did you ever find an answer to this? I’m interested in exactly this, finding out who (if anyone) is logged in before I log in myself. Unfortunately, even if the last user actually logged out, his name will be presented by the prompt for the next login (a “convenience”, I suppose, but it hides whether or not that user is actually still logged in or not).

  17. prerna says

    May 16, 2017 at 1:02 am

    WMIC /NODE:”computername” COMPUTERSYSTEM GET USERNAME
    will return “UserName” string instead of actual logged in user name in windows 10 and widows server 2012

  18. Tom says

    December 22, 2016 at 12:31 pm

    How about from the lock screen? Say if you want to check if anyone else is logged in before logging in to install updates that are going to require a system restart?

Did this help? Let us know!

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Primary Sidebar

Recent Posts

  • What is SMPS?
  • How to Find Watched Videos on Facebook in 2023
  • How to View Facebook Memories in 2023
  • How to Fix Google Maps Voice Directions Not Working
  • What Happens to Messages When You Permanently Delete Facebook
  • How to Connect Bluetooth Headphones to Steam Deck
  • How to Reset Root Password on Steam Deck
  • How to Update Steam Deck

Who’s Behind Technipages?

Baby and Daddy My name is Mitch Bartlett. I've been working in technology for over 20 years in a wide range of tech jobs from Tech Support to Software Testing. I started this site as a technical guide for myself and it has grown into what I hope is a useful reference for all.

You May Also Like

  • Best Wired Computer Speakers 2022
  • Windows 95/98
  • Microsoft Windows NT
  • Microsoft Windows
  • Microsoft Windows 95
  • Windows Media Player (WMP)

© Copyright 2023 Guiding Tech Media · All Rights Reserved · Privacy