- LOGOFF – завершение сеанса пользователя Windows .
- Windows : logoff from command line
- logoff logoff
- Синтаксис Syntax
- Параметры Parameters
- Комментарии Remarks
- Примеры Examples
- How to log off on windows 10 by using cmd?
- Replies (2)
- Log Off Another User in Windows 10
- To Log Off Another User in Windows 10,
- Log Off Another User from the Command Prompt
- Log Off Another User from with PowerShell
- About Sergey Tkachenko
- 1 thought on “ Log Off Another User in Windows 10 ”
LOGOFF – завершение сеанса пользователя Windows .
Команда MODE используется для завершения сеанса пользователя (выхода из Windows). Формат командной строки:
LOGOFF [имя сеанса | ИД сеанса] [/SERVER:сервер] [/V] [/VM]
Параметры командной строки:
имя сеанса — Имя сеанса.
ID сеанса — Идентификатор сеанса.
/SERVER:сервер — Сервер удаленных рабочих столов, содержащий пользователя пользователя (по умолчанию — текущий).
/V — Отображение информации о выполненных действиях.
/VM — Завершение сеанса на сервере или в виртуальной машине. Необходимо указать уникальный идентификатор сеанса.
LOGOFF /? — отобразить справку по использованию.
logoff — завершить текущий сеанс пользователя (выйти из системы).
logoff rdp-tcp#3 /server:COMP10 — завершить сеанс с именем rdp-tcp#3 на сервере COMP10 . Имя сеанса можно определить командой QUSER /server:COMP10 .
logoff 2 /server:COMP10 — завершить сеанс с идентификатором 2 на сервере COMP10
logoff 2 /server:192.168.1.110 — то же, что и в предыдущем примере, но вместо имени сервера используется его IP-адрес.
logoff 2 /server:192.168.1.110 /V — использовать подробный режим отображения сведений о выполняемых действиях. В этом случае на экран выводится сообщение:
Будет выполнен выход user (сеанс 2) из системы ,
продолжить (n=нет)?n
Отображается не только идентификатор сеанса, но и имя пользователя. В этом режиме, завершение сеанса можно отменить, ответив n на запрос продолжить (n=нет)?n . По умолчанию, отмена завершения сеанса не выполняется.
В качестве альтернативы команде logoff можно использовать команду SHUTDOWN с параметром -l
Windows : logoff from command line
We can logoff a user session by clicking on the Logoff button in the start menu. We can logoff from command prompt(CMD) too using shutdown command. You need to run the below command.
Shutdown is a Windows in-built command. We don’t have to install it separately. Note that we can run this command from windows Run window also. This command works on all windows editions. (XP, Vista, Server 2k3/2k8, Windows 7)
There’s another command Logoff which also serves the same purpose. This command can be used to logoff sessions on the remote computers also. Find syntax below for this.
To logoff on the current system
This does not accept user name and passwords so it uses the credentials of the current logged in user on the host system.
How to force logoff without waiting for user confirmation to terminate the running applications?
The above commands do forced logoffs.В They kill all the applications one by one and at the end logs off the user.
If I want to login from command line, how do I set it up?
Open Task manager, click on Users, Right Click, manage user account, it will open control panel. It the path above, open cmd from here. shutdown -l to log out.
Login again. It works.
need to logoff but cannot
i need to log out from anther user with the user name
sameing like that…
logoff username:moss /server:172.19.19.50
logoff logoff
Область применения: 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:
How to log off on windows 10 by using cmd?
What is the cmd-command for log off and shut down computer?
Would appreciate any help.
***Post moved by the moderator to the appropriate forum category.***
Replies (2)
There are a lot of command line in CMD you can use to logoff a computer. When you type the command «shutdown /» in CMD, it will show you the list of command controls you can use with it as for your options. With what you have stated, «shutdown /l» with the letter «L» meaning logoff, would be the most appropriate.
Let us know if this answers your question.
25 people found this reply helpful
Was this reply helpful?
Sorry this didn’t help.
Great! Thanks for your feedback.
How satisfied are you with this reply?
Thanks for your feedback, it helps us improve the site.
How satisfied are you with this reply?
Thanks for your feedback.
We have noticed that the post has been inactive for quite some time. We’d like to check if Nick Dich was able to answer your question.
If so, we highly encourage you to inform our Community by clicking on Yes or marking the post as an answer. This will help other members who may have the same issue as you. Otherwise, don’t hesitate to update us so we can further assist you.
13 people found this reply helpful
Was this reply helpful?
Sorry this didn’t help.
Great! Thanks for your feedback.
How satisfied are you with this reply?
Thanks for your feedback, it helps us improve the site.
Log Off Another User in Windows 10
How to Log Off Another User in Windows 10
Although the concept of multiple users sharing one device or one PC is getting rarer by the day, there are still cases when you have to share PCs and switch users fast. Sometimes you need to end a session for another user signed in to your computer. Here are a number of methods you can use.
The situation can be different when you need to end a user session. For example, someone just forgot to sign out from his or her user account, and left running apps and opened docs, so the remain in your computer’s memory and consume its system resources. In this case, it could be useful to kick out the inactive session for the other user.
There are no third party tools required. This can be done using either Task Manager, Command Prompt or PowerShell.
To Log Off Another User in Windows 10,
- Open the Task Manager app.
- If it looks as follows, switch it to the full view using the «More details» link in the bottom right corner.
- Click on the Users tab.
- Right-click on a user account you want to log off.
- Select Sign off from the context menu.
Alternatively, there are a couple of console tools we can use for the same purpose. Let’s review them.
Log Off Another User from the Command Prompt
- Open an elevated command prompt.
- Type or copy-paste the following command: query session . This will list available user sessions.
- Note the ID column value for the user you want to sign off.
- Now, execute the command logoff . For example, logoff 1 .
Finally, you can use PowerShell, as follows.
Log Off Another User from with PowerShell
- Open PowerShell as Administrator.Tip: You can add «Open PowerShell As Administrator» context menu.
- Type or copy-paste the following command: $sessionID = ((quser /server:’you computer name’ | Where-Object < $_ -match 'user name to sign off' >) -split ‘ +’)[2]
- Now, execute the command logoff $sessionID .
The PowerShell method is great when you know the exact user name. You can save it as a script and sign out other users with one click when needed.
Related blog posts:
Winaero greatly relies on your support. You can help the site keep bringing you interesting and useful content and software by using these options:
Share this post
About Sergey Tkachenko
Sergey Tkachenko is a software developer from Russia who started Winaero back in 2011. On this blog, Sergey is writing about everything connected to Microsoft, Windows and popular software. Follow him on Telegram, Twitter, and YouTube.
1 thought on “ Log Off Another User in Windows 10 ”
To note, the logoff command is not available on Windows 10 Home editions.