Область применения: Windows Server (половина ежегодного канала), Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012 Applies to: Windows Server (Semi-Annual Channel), Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Выполнит выход пользователя из сеанса на удаленный рабочий стол сервере узла сеансов и удалит сеанс. Logs off a user from a session on a Remote Desktop Session Host server and deletes the session.
Синтаксис Syntax
Параметры Parameters
Параметр Parameter
Описание Description
Указывает имя сеанса. Specifies the name of the session. Это должен быть активный сеанс. This must be an active session.
Указывает числовой идентификатор, определяющий сеанс на сервере. Specifies the numeric ID which identifies the session to the server.
/server: /server:
Указывает сервер узла сеансов удаленный рабочий стол, содержащий сеанс, для которого пользователь должен выйти из системы. Specifies the Remote Desktop Session Host server that contains the session whose user you want to log off. Если не указано, используется сервер, на котором активна в данный момент. If unspecified, the server on which you are currently active is used.
/v /v
Отображает сведения о выполняемых действиях. Displays information about the actions being performed.
/? /?
Отображение справки в командной строке. Displays help at the command prompt.
Комментарии Remarks
Вы всегда можете выйти из сеанса, к которому в данный момент выполнен вход. You can always log off yourself from the session to which you are currently logged on. Однако необходимо иметь разрешение « полный доступ» для выхода пользователей из других сеансов. You must, however, have Full Control permission to log off users from other sessions.
Выход пользователя из сеанса без предупреждения может привести к утрате данных в сеансе пользователя. Logging off a user from a session without warning can result in loss of data at the user’s session. Необходимо отправить пользователю сообщение с помощью команды MSG , чтобы предупредить пользователя перед выполнением этого действия. You should send a message to the user by using the msg command to warn the user before taking this action.
Если параметр или не указан, функция выхода из системы выполняет выход пользователя из текущего сеанса. If or isn’t specified, logoff logs the user off from the current session.
После выхода пользователя из системы все процессы завершаются, а сеанс удаляется с сервера. After you log off a user, all processes end and the session is deleted from the server.
Пользователь не может выйти из сеанса консоли. You can’t log off a user from the console session.
Примеры Examples
Для выхода пользователя из текущего сеанса введите: To log off a user from the current session, type:
Для выхода пользователя из сеанса с помощью идентификатора сеанса, например сеанса 12, введите: To log off a user from a session by using the session’s ID, for example session 12, type:
Для выхода пользователя из сеанса с использованием имени сеанса и сервера, например Session TERM04 на сервере Server1, введите: To log off a user from a session by using the name of the session and server, for example session TERM04 on Server1, type:
Windows Setup Log Files and Event Logs
Windows® Setup creates log files for all actions that occur during installation. If you are experiencing problems installing Windows, consult the log files to troubleshoot the installation.
WindowsВ Setup log files are available in the following directories:
Log file location
Description
Log location before Setup can access the drive.
Log location when Setup rolls back in the event of a fatal error.
Log location of Setup actions after disk configuration.
Used to log Plug and Play device installations.
Location of memory dump from bug checks.
Location of log minidumps from bug checks.
Location of Sysprep logs.
WindowsВ Setup Event Logs
WindowsВ Setup includes the ability to review the WindowsВ Setup performance events in the Windows Event Log viewer. This enables you to more easily review the actions that occurred during WindowsВ Setup and to review the performance statistics for different parts of WindowsВ Setup. You can filter the log so as to view only relevant items that you are interested in. The WindowsВ Setup performance events are saved into a log file that is named Setup.etl, which is available in the %WINDIR%\Panther directory of all installations. To view the logs, you must use the Event Viewer included with the Windows media that corresponds to the version of the customized image that you are building.
To view the logs on a computer that does not include the corresponding kit, you must run a script from the root of the media that installs the Event Trace for Windows (ETW) provider. From the command line, type:
where D is the drive letter of the Windows DVD media.
To view the WindowsВ Setup event logs
Start the Event Viewer, expand the Windows Logs node, and then click System.
In the Actions pane, click Open Saved Log and then locate the Setup.etl file. By default, this file is available in the %WINDIR%\Panther directory.
The log file contents appear in the Event Viewer.
To Export the log to a file
From the command line, use the Wevtutil or Tracerpt commands to save the log to an .xml or text file. For information about how to use these tools, see the command-line Help. The following commands show examples of how to use the tools:
Как посмотреть логи Windows?
Логи — это системные события, который происходят в любой операционной системе. С помощью логов можно легко отследить кто, что и когда делал. Читать логи могут не только системные администраторы, поэтому в данной инструкции рассмотрим, как смотреть логи ОС windows.
Ищете сервер с Windows? Выбирайте наши Windows VDS
Просмотр событий для проверки логов.
После нажатия комбинации “ Win+R и введите eventvwr.msc ” в любой системе Виндовс вы попадаете в просмотр событий. У вас откроется окно, где нужно развернуть Журналы Windows. В данном окне можно просмотреть все программы, которые открывались на ОС и, если была допущена ошибка, она также отобразится.
Аудит журнал поможет понять, что и кто и когда делал. Также отображается информация по запросам получения доступов.
В пункте Установка можно посмотреть логи ОС Виндовс, например, программы и обновления системы.
Система — наиболее важный журнал. С его помощью можно определить большинство ошибок ОС. К примеру, у вас появлялся синий экран. В данном журнале можно определить причину его появления.
Логи windows — для более специфических служб. Это могут быть DHCP или DNS.
Фильтрация событий.
С помощью Фильтра текущего журнала (раздел Действия) можно отфильтровать информацию, которую вы хотите просмотреть.
Обязательно нужно указать уровень Событий:
Критическое
Ошибка
Предупреждение
Сведения
Подробности
Для сужения поиска можно отфильтровать источник событий и код.
Просмотр PowerShell логов.
Открываем PowerShell и вставляем следующую команду Get-EventLog -Logname ‘System’
В результате вы получите логи Системы
Для журнала Приложения используйте эту команду Get-EventLog -Logname ‘Application
Также обязательно ознакомьтесь с перечнем аббревиатур:
Код события — EventID
Компьютер — MachineName
Порядковый номер события — Data, Index
Категория задач — Category
Код категории — CategoryNumber
Уровень — EntryType
Сообщение события — Message
Источник — Source
Дата генерации события — ReplacementString, InstanceID, TimeGenerated
Дата записи события — TimeWritten
Пользователь — UserName
Сайт — Site
Подразделение — Conteiner
Для выведения событий в командной оболочке только со столбцами «Уровень», «Дата записи события», «Источник», «Код события», «Категория» и «Сообщение события» для журнала «Система» используйте:
Для фильтрации журнала, например, для фильтрации последних 20 сообщений, используйте команду
Get-EventLog –Logname ‘System’ –Newest 20
Если нужен список, позднее даты 1 января 2018 года, команда
Get-EventLog –LogName ‘System’ –After ‘1 января 2018’
Надеемся, данная статья поможет вам быстро и просто читать логи ОС Windows.
Желаем приятной работы!
Как установить свой образ на ВДС сервер с Виндовс, читайте в предыдущей статье.
Logging Off
The ExitWindows function logs off the current user. You can also call the ExitWindowsEx function with the EXW_LOGOFF flag.
By default, when an application uses ExitWindows or ExitWindowsEx to log off, the system sends the WM_QUERYENDSESSION message to each window. Applications agree to terminate by returning TRUE when they receive this message. If any application returns FALSE when processing this message, the log-off operation is canceled. If your application handles the WM_QUERYENDSESSION message, you can allow the user to cancel the log-off operation, even if another application or the system originated the end-session request. For an example, see How to Log Off the Current User.
When an application returns TRUE for WM_QUERYENDSESSION, it receives the WM_ENDSESSION message and it is terminated, regardless of how the other applications respond to the WM_QUERYENDSESSION message.
To force all applications to terminate, use ExitWindowsEx, and specify the EXW_FORCE flag. This prevents the system from sending WM_QUERYENDSESSION messages.
The system also sends the CTRL_LOGOFF_EVENT control signal to every process during a log-off operation. A console application can register a HandlerRoutine to process these messages.
If the process that called ExitWindowsEx is running in the logon session of the interactive user, all processes in the logon session are terminated. If the process calling ExitWindowsEx is in some other logon session, only the notifications are made; no processes are terminated.
Windows 10 Logs Off when Shutdown or Hibernate is used
Over these years, at least since the Windows 7 era, we’ve seen several cases where the system logs you off when clicking on the Shutdown or Hibernate option in the Start menu. The problem may be seen in Windows 8 or Windows 10 computers as well. Some users have indicated that the problem occurred after installing Windows 10 v1903.
What causes Windows to log off the user instead when shutdown or hibernate option is used?
Cause
During hibernation, Windows reads the contents in the memory and dumps it into a file named hiberfil.sys on the system drive’s root. The crash dump feature uses the same technology to dump the memory contents to a file (.dmp) in your hard disk in the aftermath of a system crash. Both hibernate and crash dump features use a special filter driver named dumpfve.sys to do the task of dumping the memory to file.
The file dumpfve.sys is mentioned in the following registry key, in a REG_MULTI_SZ value named DumpFilters
The multi-string registry value allows third-party providers to add the crash dump filter drivers — e.g., Truecrypt.sys from TrueCrypt, MfeEpeOpal.sys from McAfee Endpoint Encryption, or Daemon Tools filter driver, etc. Most disk encryption products typically also want to encrypt hibernation & crash dump files and add their dump filters in the above registry key.
The dump filter drivers mentioned in the registry key are loaded when crash dump or hibernation is initialized. If Windows is unable to load the filter drivers during the hibernate process, it generates an event log entry with the Event ID 45. The event log entry looks like the following:
Additionally, when you go to the Details tab in this event and then select friendly view, you may notice the following:
The problem may occur during the shutdown as well. How?
If Fast Startup is enabled, the system logs off all the user sessions completely and then hibernates the system instead of performing a clean shut down. Fast Startup relies upon the hibernation feature, and it dumps the kernel memory to hiberfil.sys file. When fast startup is enabled and a user shuts down the computer, all sessions are logged off, and the computer enters hibernation. As part of the hibernation process, Windows initializes the system’s memory dump configuration. If the filter driver(s) is not loaded, it fails to hibernate, and brings you back to the Windows Lock Screen of the sign-in screen.
To avoid the problem from happening during shutdown (not hibernate), you can disable fast startup or bypass fast startup during shutdown on a per-session basis by running shutdown.exe /s /t 0 to shut down the computer. To disable Fast Startup:
Open Control Panel → All Control Panel Items → Power Options (or run powercfg.cpl )
Click Choose what the power buttons do
Click Change settings that are currently unavailable
Uncheck Turn on fast startup
Click OK.
However, turning off fast startup is a compromise. It’s not a feasible thing to do for most users, as the restart process in Windows continues to perform a full boot cycle, without the hibernation performance benefits.
Resolution: Windows Logs Off User when Shutdown or Hibernate is used
To fix the problem, remove third-party crash dump filter driver references from the registry using the following steps:
Start the Registry Editor ( regedit.exe ) and go to the following key:
Backup the key by exporting it to a .reg file.
Double-click the DumpFilters multi-string value.
Remove all the third-party filter drivers listed in the value. Note that the Windows default driver dumpfve.sys should not be removed.
Exit the Registry Editor.
Restart Windows.
The hibernate and shutdown features should now work correctly — with or without Fast Startup enabled.