При расследовании различных инцидентов администратору необходимо получить информацию кто и когда заходил на определенный компьютер Windows. Историю входов пользователя в доменной сети можно получить из журналов контроллеров домена. Но иногда проще получить информацию непосредсвенно из логов компьютера. В этой статье мы покажем, как получить и проанализировать историю входа пользователей на компьютер/сервер Windows. Такая статистика поможет вам ответить на вопрос “Как в Windows проверить кто и когда использовал этот компьютере”.
Содержание:
- Настройка политики аудита входа пользователей в Windows
- Поиск событий входа пользователей в журнале событий Windows
- Анализ событий входа пользователей в Windows с помощью PowerShell
Настройка политики аудита входа пользователей в Windows
Сначала нужно включить политик аудита входа пользователей. На отдельностоящем компьютере для настройки параметров локальной групповой политики используется оснастка gpedit.msc. Если вы хотите включить политику для компьютеров в домене Active Directorty, нужно использовать редактор доменных GPO (
gpmc.msc
).
- Запустите консоль GPMC, создайте новую GPO и назначьте ее на Organizational Units (OU) с компьютерами и / или серверами, для которых вы хотите включить политику аудита событий входа;
- Откройте объект GPO и перейдите в раздел Computer Configuration -> Policies -> Windows Settings -> Security Settings –> Advanced Audit Policy Configuration -> Audit Policies -> Logon/Logoff;
- Включите две политики аудита Audit Logon и Audit Logoff. Это позволит отслеживать как события входа, так и события выхода пользователей. Если вы хотите отслеживать только успешные события входа, включите в настройках политик только опцию Success;
- Закройте редактор GPO и обновите настройки политик на клиентах.
Поиск событий входа пользователей в журнале событий Windows
После того как вы включили политики аудита входа, при каждом входе пользователя в Windows в журнале Event Viewer будет появляться запись о входе. Посмотрим, как она выглядит.
- Откройте оснастку Event Viewer (
eventvwr.msc
); - Разверните секцию Windows Logs и выберите журнал Security;
- Щелкните по нему правой клавишей и выберите пункт Filter Current Log;
- В поле укажите ID события 4624 и нажмите OK;
- В окне события останутся только события входа пользователей, системных служб с описанием
An account was successfully logged on
; - В описании события указано имя и домен пользователя, вошедшего в систему:
New Logon: Security ID: WINITPRO\a.khramov Account Name: a.khramov Account Domain: WINITPRO
Ниже перечислены другие полезные EventID:
Event ID | Описание |
4624 | A successful account logon event |
4625 | An account failed to log on |
4648 | A logon was attempted using explicit credentials |
4634 | An account was logged off |
4647 | User initiated logoff |
Если полистать журнал событий, можно заметить, что в нем присутствуют не только события входа пользователей на компьютер. Здесь также будут события сетевого доступа к этому компьютеру (при открытии по сети общих файлов или печати на сетевых принтерах), запуске различных служб и заданий планировщика и т.д. Т.е. очень много лишний событий, которые не относятся ко входу локального пользователя. Чтобы выбрать только события интерактивного входа пользователя на консоль компьютера, нужно дополнительно сделать выборку по значению параметра Logon Type. В таблице ниже перечислены коды Logon Type.
Код Logon Type | Описание |
---|---|
0 | System |
2 | Interactive |
3 | Network |
4 | Batch |
5 | Service |
6 | Proxy |
7 | Unlock |
8 | NetworkCleartext |
9 | NewCredentials |
10 | RemoteInteractive |
11 | CachedInteractive |
12 | CachedRemoteInteractive |
13 | CachedUnlock |
При удаленном подключении к рабочему столу компьютера по RDP, в журнале событий появится записи с Logon Type 10 или 3. Подробнее об анализе RDP логов в Windows.
В соответствии с этой таблицей событие локального входа пользователя на компьютер должно содержать Logon Type: 2.
Для фильтрации события входа по содержать Logon Type лучше использовать PowerShell.
Анализ событий входа пользователей в Windows с помощью PowerShell
Допустим, наша задача получить информацию о том, какие пользователи входили на этот компьютер за последнее время. Нам интересует именно события интерактивного входа (через консоль) с
LogonType =2
. Для выбора события из журналов Event Viewer мы воспользуемся командлетом Get-WinEvent.
Следующий PowerShell скрипт выведет история входа пользователей на текущий компьютер и представит ее в виде графической таблицы Out-GridView.
$query = @'
<QueryList>
<Query Id='0' Path='Security'>
<Select Path='Security'>
*[System[EventID='4624']
and(
EventData[Data[@Name='VirtualAccount']='%%1843']
and
EventData[Data[@Name='LogonType']='2']
)
]
</Select>
</Query>
</QueryList>
'@
$properties = @(
@{n='User';e={$_.Properties[5].Value}},
@{n='Domain';e={$_.Properties[6].Value}},
@{n='TimeStamp';e={$_.TimeCreated}}
@{n='LogonType';e={$_.Properties[8].Value}}
)
Get-WinEvent -FilterXml $query | Select-Object $properties|Out-GridView
Если нужно выбрать события входа за последние несколько дней, можно добавить pipe с таким условием:
|Where-Object {$_.TimeStamp -gt '5/10/22'}
Командлет Get-WinEvent позволяет получить информацию с удаленных компьютеров. Например, чтобы получить историю входов с двух компьютеров, выполните следующий скрипт:
'msk-comp1', 'msk-comp2' |
ForEach-Object {
Get-WinEvent -ComputerName $_ -FilterXml $query | Select-Object $properties
}
Если протокол RPC закрыт между компьютерами, вы можете получить данные с удаленных компьютеров с помощью PowerShell Remoting командлета Invoke-Command:
Invoke-Command -ComputerName 'msk-comp1', 'msk-comp2' {Get-WinEvent -FilterXml $query | Select-Object $properties}
How to Know if Someone Logged Into Your Windows 10?
Windows 10 lets you see which users are logged into your PC using Event Viewer (and when they logged in). This article is dedicated to Windows Home Edition users interested in Windows auditing.
Event viewer is a Windows component that enables administrators and regular users to view event logs on a local or remote machine. It uses event IDs to define uniquely identifiable events that a Windows computer might encounter.
Event Viewer displays a log of application and system information messages, including warnings and errors (these are displayed even if your system is running correctly).
This feature is helpful if you are troubleshooting a specific problem and require more information about the cause. You can look for events in different categories such as «Application,» «System,» and «Security.» Here, we will focus on the «Security» category of Event Viewer.
NOTE: If you run Windows 10 Home, you will only see successful login attempts (this log is enabled by default in this edition). You have to use Windows Pro edition with the included Local Group Policy Editor to allow full login auditing.
Video Showing How to See Who Logged Into Your Windows 10:
Table of Contents:
- Introduction
- How to See Who Logged Into Windows 10 Using Event Viewer
- How to Set a Custom Filter In Event Viewer
- Video Showing How to See Who Logged Into Your Windows 10
Download Computer Malware Repair Tool
It is recommended to run a free scan with Combo Cleaner — a tool to detect viruses and malware on your device. You will need to purchase the full version to remove infections. Free trial available. Combo Cleaner is owned and operated by Rcs Lt, the parent company of PCRisk.com read more.
How to See Who Logged Into Windows 10 Using Event Viewer
First, open Event Viewer by typing «event viewer» in Search and click the «Event Viewer» result.
In the Event Viewer, expand the «Windows Logs» category and select «Security.» You will see a list of events. Events with ID number 4624 indicate successful sign-ins.
Double click an event with this ID number (4264) to see details. If you are using Windows 10 Pro, you will also see events with ID 4625 (unsuccessful attempts) and 4634 (user log-off) — double-click these to see details.
In the «Logged» section, you can see when someone is logged into your PC (including you). In the «General» tab, look for «New Logon,» and you will see the account that is logged in.
[Back to Table of Contents]
How to Set a Custom Filter In Event Viewer
As mentioned, Event Viewer keeps many logs with a great deal of information, so it may be not easy to find a particular event ID (there could be hundreds of events logged throughout the day). A filter feature in the Event Viewer enables you to create a custom view to see only particular event IDs. We use a filter to see only the IDs of logged events pertaining to login attempts in this example. Right-click on «Custom Views» and select the «Create Custom View…» option to create this filter.
In the Create Custom View window, look for the «Logged» section and select a time range.
Then choose to view «By log» and select «Security» from the «Windows Logs» drop-down menu.
In the Event ID field, type the ID number ‘4624’ and click OK.
Name your Custom View filter and click OK.
Your Custom View filter is now created, and you can see all events logged that match your criteria. Double click the event to see details.
You will now be able to find out who and when users successfully logged in to your PC. This guide works on earlier versions of Windows, such as Windows 7 & 8.1. Hope this helped!
[Back to Top]
В некоторых случаях, особенно в целях родительского контроля, может потребоваться узнать, кто и когда включал компьютер или входил в систему. По умолчанию, каждый раз, когда кто-то включает компьютер или ноутбук и входит в Windows, в системном журнале появляется запись об этом.
Просмотреть такую информацию можно в утилите «Просмотр событий», однако есть способ проще — отображение данных о предыдущих входах в Windows 10 на экране входа в систему, что и будет показано в этой инструкции (работает только для локальной учетной записи). Также на схожую тему может пригодиться: Как ограничить количество попыток ввода пароля Windows 10, Родительский контроль Windows 10.
Узнаем, кто и когда включал компьютер и входил в Windows 10 с помощью редактора реестра
В первом способе используется редактор реестра Windows 10. Рекомендую предварительно сделать точку восстановления системы, может пригодиться.
- Нажмите клавиши Win+R на клавиатуре (Win — это клавиша с эмблемой Windows) и введите regedit в окно «Выполнить», нажмите Enter.
- В редакторе реестра перейдите к разделу (папки слева) HKEY_LOCAL_MACHINE\ SOFTWARE\ Microsoft\ Windows\ CurrentVersion\ Policies\ System
- Нажмите правой кнопкой мыши в пустом месте правой части редактора реестра и выберите «Создать» — «Параметр DWORD 32 бита» (даже если у вас 64-разрядная система).
- Введите имя DisplayLastLogonInfo для этого параметра.
- Дважды кликните по вновь созданному параметру и задайте значение 1 для него.
По завершении закройте редактор реестра и перезагрузите компьютер. При следующем входе в систему вы увидите сообщение о предыдущем успешном входе в Windows 10 и о неудачных попытках входа, если такие были, как на скриншоте ниже.
Отображение информации о предыдущем входе в систему с помощью редактора локальной групповой политики
Если у вас установлена Windows 10 Pro или Enterprise, то описанное выше вы можете сделать и с помощью редактора локальной групповой политики:
- Нажмите клавиши Win+R и введите gpedit.msc
- В открывшемся редакторе локальной групповой политики перейдите к разделу Конфигурация компьютера — Административные шаблоны — Компоненты Windows — Параметры входа Windows.
- Дважды кликните по пункту «Отображать при входе пользователя сведения о предыдущих попытках входа», установите значение «Включено», нажмите Ок и закройте редактор локальной групповой политики.
Готово, теперь при следующих входах в Windows 10 вы будете видеть дату и время удачных и неудачных входов этого локального пользователя (функция поддерживается также для домена) в систему. Также может заинтересовать: Как ограничить время использования Windows 10 для локального пользователя.
-
Home
-
News
- How to Check Computer Login History on Windows 10/11?
By Stella | Follow |
Last Updated
You may want to know who has logged into your computer and when. But do you know how to check it? To help you do this, MiniTool Software shows you a full guide on how to check computer login history on Windows 10/11. If you are running Windows 8/8.1 or Windows 7, this guide is also available.
Tip: If you are looking for a free file recovery tool, you can try MiniTool Power Data Recovery. This software can help you recover all kinds of files from hard drives, SD cards, memory cards, SSDs, and more, as long as the files are not overwritten by new data.
MiniTool Power Data Recovery TrialClick to Download100%Clean & Safe
Sometimes you may feel that someone is logged into your computer, but you are not sure. Well then, is it possible to check if someone logged into your Windows computer? Of course, yes. Windows 10/11 has an Audit logon events policy that allows you to view login history on Windows 10/11. However, this policy is not enabled by default on your device. So, you need to manually enable it. Then you can see the Windows login log to know which has logged into your PC.
How to Check Computer Login History on Windows 10/11?
Step 1: Enable Audit Logon Events on Windows 10/11
Tip: You need to enable Audit logon events using Local Group Policy, which is available in Windows 10/11 Pro or more advanced versions. If you are running Windows 10/11 Home, the thing is different because this feature is enabled by default on your computer. So, you can just skip to the next step to view login history on Windows 10/11.
The following guide is based on Windows 11. If you are running Windows 10, the steps are the same.
- Click the search bar from the taskbar and search for gpedit.msc.
- Click the first result to open Local Group Policy Editor.
- Go to this path: Computer Configuration > Windows Settings > Security Settings > Local Policies > Audit Policy.
- Find Audit logon events from the right panel. Then, double-click it to open Properties.
- Check both Success and Failure under Local Security Setting.
- Click Apply.
- Click OK.
After these steps, your Windows computer will begin to track the login attempts no matter it is successful or not.
Tip: If you don’t want to track the login history, you can uncheck Success and Failure in step 5.
Step 2: Find out Who Is Logged into Your Computer
You can use the Event Viewer to check who is logged into your computer and when. Here is a guide on how to find out who is logged into your computer:
- Right-click Start and select Event Viewer.
- Go to Windows Logs > Security.
- Find the 4624 event ID and double-click it to open it.
- Under the General section, check the Account Name. It is the account who have logged into your device. You can see when that account was logged in the computer under Logged.
After clicking Security, you can see that there are many logon reports. It may take some time to find your needed log. Fortunately, you can use the filter feature of Event Viewer to make the task easier.
1. Right-click Custom Views and click Create Custom View.
2. Under the Filter section, you need to:
- Select a time range for Logged.
- Select By log and then select Security under Windows logs for Event logs.
- Type 4624 in the All Event IDs box.
3. Click OK to save the changes.
Now, you can easily find the Windows 10/11 login history.
About The Author
Position: Columnist
Stella has been working in MiniTool Software as an English Editor for more than 8 years. Her articles mainly cover the fields of data recovery including storage media data recovery, phone data recovery, and photo recovery, videos download, partition management, and video & audio format conversions.
,
If you want to view the user login history in Windows 10/11, then this article contains step by step instructions on how to do that.
When a user logs on to a computer, Windows records the time and date of the logon in the Event Viewer. This allows system administrators to find out the last login time or view the full login history of users to gather information about their activity.
This tutorial is divided into two parts. The first part contains instructions on how to view a user’s last login time, and the second part shows how to view the entire user’s login history in Windows 10/11.
- Related article: How to View Last Login Time of a User in Active Directory.
Part 1. View Last Login Time in Windows 10/11.
- View Last Login Date/Time from Command Prompt.
- View Last Logon Time from PowerShell.
Part 2. View Users Login History in Windows 10/11.
- View Login-Logout History in Event Viewer.
- View Login/Logoff History with WinLogOnView.
Part 1. How to View Last Login Time and Date in Windows 11/10.
Method 1. Find Last Login Time using NET USER Command.
The easiest way to find a user’s last logon date and time in Windows 10/11, is by simply executing «NET USER <USERNAME>» command in Command Prompt or in PowerShell. To do that:
1. Open Command Prompt or PowerShell and give the following command to view all the accounts on the machine.
- net user
2. Notice the username of the account that you want to view it’s last logon time, and give the following command to find user’s last logon date and time:*
- net user Username
* Note: Replace the «Username» with the username of the user you want to view the last login time. (e.g. «John» in this example.)
Method 2. Find Last Login Time of All Accounts in PowerShell.
If you want to view the last login date and time of all users in Windows 10/11, then open PowerShell and give the following command:*
- Get-LocalUser | Select Name, Lastlogon
* Note: The above command will show you the last login time of all accounts on your Windows 10/11 computer. If the last logon time for a user is blank, it means that the user has never logged on to the computer.
Part 2. How to View User Login History in Windows 10/11.
Method 3. View User Login-Logout History in Event Viewer.
The Windows Event Viewer allows system users to view all events logged by the system, such as errors or additional information about what has happened, for troubleshooting purposes.
To check the login history in Event Viewer, go to Security logs and view the events with Event ID 4624 or 4648 to view the Logon times, or look at 4647 events to view the Logout times. To do that:
1. Type event viewer on the search box and then open the Event Viewer app.
2. Expand the Windows Logs and select Security.
3a. In Security logs, open one-by-one all the events with Event ID 4624 (or 4648), and find which one has as Logon Type = 2 & at Account Name shows the username of a user (and not SYSTEM, NETWORK SERVICE, etc.).*
3a. Finally, view the Logged time, to see the login time and date of the user.
4. To view the Logoff times of a user, see the events with Event ID 4647.*
* Note: To make you life easier, Create a custom view and type 4624 or 4648 for Logon, or 4647 for Logoff, or see the next method.
Method 4. View Logon & Logoff Times with WinLogOnView.
In my opinion, the easiest way to see all users’ login and logout history, is by using the third-party utility WinLogOnView by NirSoft. To do that:
1. Download WinLogOnView and extract the ZIP file to a folder.
2. Explore the extracted folder and run the WinLogOnView application.
3. On your screen you will see the login and logout time of each computer user, the total duration of their connection and the IP address from which they connected (127.0.0.1 = locally).
That’s it! Which method worked for you?
Let me know if this guide has helped you by leaving your comment about your experience. Please like and share this guide to help others.
If this article was useful for you, please consider supporting us by making a donation. Even $1 can a make a huge difference for us in our effort to continue to help others while keeping this site free:
- Author
- Recent Posts
Konstantinos is the founder and administrator of Wintips.org. Since 1995 he works and provides IT support as a computer and network expert to individuals and large companies. He is specialized in solving problems related to Windows or other Microsoft products (Windows Server, Office, Microsoft 365, etc.).