Check which users are logged in windows server

Windows 10: Find Who is Logged in

By Mitch Bartlett 17 Comments

If you’re wondering how to find out who is currently logged into a Microsoft Windows 10 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.
  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.
  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
Читайте также:  Windows 10 1903 против 1909

You Might Also Like

Filed Under: Windows Tagged With: Windows 10

Check which users are logged in windows server

This forum has migrated to Microsoft Q&A. Visit Microsoft Q&A to post new questions.

Answered by:

Question

Windows Server 2008 R2 Enterprise.

I had a snap-in in Windows Server 2003 that allowed me to see who was currently logged onto the domain. How can I do this in Windows Server 2008 R2? I am the administrator, so there is no privilege issue. Thanks for any help.

Doug Pruiett Good News Jail & Prison Ministry Richmond, Virginia www.goodnewsjail.org

Answers

There is no direct way to check the same if auditing is enabled you can check the DC event log to track the same.You can also use thrid party tool (PSLogggedON or ManageEngine )or script to check the same.

Hope this helps

Disclaimer: This posting is provided «AS IS» with no warranties or guarantees , and confers no rights.

You can either scan the event id from the security log on the DC. You can utilize EventcombMT to read or search the particular event id from single server. The other way is using Pslogged on tool or some other method mentioned in the below article.

Awinish Vishwakarma — MVP — Directory Services

Disclaimer This posting is provided AS-IS with no warranties/guarantees and confers no rights.

What’s the best way to see logged in users in Windows Server 2012?

Right now I use a powershell script to see the currently logged in users. But I don’t see if their session is idle, active or inactive. I can see when the session was started, that’s it. Is there an easy way to see how many users are currently logged in to the server I am logged in and see their status? It should not be remotely executed. I would like to avoid third party tools if possible.

7 Answers 7

Use the query user command

Open the Task-Manager and see the users tab. There you will find a list of users and their status.

where 192.168.1.9 is the IP of the server

«quser» command will give you the active now users

the same result will give you the «qwinsta» command

Use quser or query user to check users connected

Use qwinsta or query session to check sessions connected

Also you can use the «UserLock» application to see which users logged in. By this 3rd party tool you can manage the session of the users as well as remote desktop sessions. It is a great tool in this case. I suggest you try this tool.

Читайте также:  Windows не загружается после замены оперативной памяти

Its easy in Server 2016 when you are in a session:

Click the search glass bottom left on task bar

Type gateway in the box and this should bring up «Remote Desktop Gateway Manager»; select it.

Click on the «>» next to the RDS server you want to view (RDS-01) for most I guess, then select the monitoring folder

You can now see who is logged on, how long for, since what time and can disconnect them or set connection limits.

Please note you probably need certain admin rights to do this, but it works for me.

Check which users are logged in windows server

This forum has migrated to Microsoft Q&A. Visit Microsoft Q&A to post new questions.

Answered by:

Question

Is there an easy way to find out which computer a domain user is logging onto? It shows in Event viewer but it takes a lot of time. Windows 2003 Server.

Answers

you can proceed like that:

  • Create a Share on a Server and give right NTFS and Share permissions
  • Create a Batch file in which you put this script: echo user: %username% computer: %computername% date: %date% > \\Server\Share\info.txt
  • Use group policies to apply this Batch file as a logon script

At the end you will get in the text file info.txt:

  • The user name
  • The used computer
  • The date of logon

This posting is provided «AS IS» with no warranties or guarantees , and confers no rights.

Microsoft Student Partner 2010 / 2011
Microsoft Certified Professional
Microsoft Certified Systems Administrator: Security
Microsoft Certified Systems Engineer: Security
Microsoft Certified Technology Specialist: Windows Server 2008 Active Directory, Configuration
Microsoft Certified Technology Specialist: Windows Server 2008 Network Infrastructure, Configuration
Microsoft Certified Technology Specialist: Windows Server 2008 Applications Infrastructure, Configuration
Microsoft Certified Technology Specialist: Windows 7, Configuring
Microsoft Certified IT Professional: Enterprise Administrator

PsLoggedOn tool can be used to find current logged on user to which computer.

Regards

Disclaimer : This posting is provided AS-IS with no warranties or guarantees and confers no rights.

use some scripts as provided already from Richard Mueller:

Best regards Meinolf Weber Disclaimer: This posting is provided «AS IS» with no warranties or guarantees , and confers no rights.

Other than PsLoggedOn, this is not easy. AD does not track which user is logged into which computer. You can find which user is logged into a specified computer with a script that connects to the computer, but to find which computer is used by a specific user requires a search of all available computers. Another solution would be a logon script that logs the user and computer names to a shared log file. The command suggested by Mr X could be used. Then you could search the shared log file for the last entry for the user. Or, I have example logon and logoff scripts linked here that log similar information:

Читайте также:  Забыл пароль от ноута что делать windows 10

There is also a program linked on the page, ParseLogons.vbs, that reads the result log file and parses the logon and logoff events for user sessions. This will tell you if the user is still logged on (if the last event for the user is a logon). A VBScript program that reports who is logged into a specific computer could be as below:

Dim colProperties, strNameOfUser, strUserDomain

‘ Specify or prompt for remote computer.
strComputer = «WST0123»

Set objWMIService = GetObject(«winmgmts:» _
& «!\\» _
& strComputer & «\root\cimv2»)
Set colProcesses = objWMIService.ExecQuery _
(«SELECT * FROM Win32_Process WHERE Name = ‘explorer.exe'»)
For Each objProcess In colProcesses
colProperties = objProcess.GetOwner(strNameOfUser, strUserDomain)
Wscript.Echo «Owner of Explorer.exe on » & strComputer _
& » is » & strUserDomain & «\» & strNameOfUser
Next

This could be modified to retrieve all computers in the domain (using ADO to retrieve all of the names from AD), ping each to see if it is available, then contact each with code similar to above to see if the specified user is logged on. PsLoggedOn does the same, but would be easier to use.

How to find a logged-in user remotely using PowerShell

  • Create a certificate-signed RDP shortcut via Group Policy — Fri, Aug 9 2019
  • Monitor web server uptime with a PowerShell script — Tue, Aug 6 2019
  • How to build a PowerShell inventory script for Windows Servers — Fri, Aug 2 2019

A Windows admin might need this information to create reports, to track down malware infection or to see who’s in the office. Since this is a repeatable task, it’s a good idea to build a script that you can reuse over and over again, rather than having to figure out how to do it every time.

In this article, I’m going to go over how to build a PowerShell script to find a logged-on user on your local Windows machine, as well as on many different remote Windows machines at once. By the end, you should have a good understanding of what it takes to query the logged-on user of a Windows computer. You will also understand how to build a PowerShell script to execute the command on multiple computers at the same time.

With PowerShell, getting the account information for a logged-on user of a Windows machine is easy, since the username is readily available using the Win32_ComputerSystem WMI instance. This can be retrieved via PowerShell by using either the Get-CimInstance or Get-WmiObject cmdlet. I prefer to use the older Get-WmiObject cmdlet because I’m still working on older machines.

Оцените статью