Как остановить выход из удаленного рабочего стола после закрытия соединения

12923
PKSA

Когда я использую подключение к удаленному рабочему столу (mstsc.exe), когда я закрываю подключение, я получаю выход из системы с удаленного компьютера.

Есть ли способ прекратить выход из системы после отключения?

Клиентские и серверные компьютеры работают только под управлением Windows 8.

Обратите внимание, что:

tscon.exe RDP-Tcp#1 /dest:console 

дает эту ошибку:

Sessionname RDP-Tcp#1 not found 

Я попробовал следующее, но безуспешно:

tscon.exe 0 /dest:console  tscon.exe 1 /dest:console 
10
Странно, это никогда не случалось со мной, используя настройки по умолчанию на win 8 или win 7. До тех пор, пока вы не нажмете кнопку win и не выйдете из системы, она должна просто закрыть сеанс, но не выйти из него. Ivan Viktorovic 8 лет назад 0
Я подключился к удаленному компьютеру, а затем выхожу из удаленного подключения. Я хочу, чтобы удаленная машина не вышла из системы PKSA 8 лет назад 0
Дело в том, что он выходит из системы удаленного пользователя при входе в систему, поэтому простое закрытие соединения не восстанавливает предыдущего пользователя. Я бы тоже хотел найти обходной путь для этого. Tetsujin 8 лет назад 0
Да, это верно, если вы используете двух разных пользователей, если он один и тот же, он просто займет этот сеанс. Вам нужен терминальный сервер или серверная версия, если вы хотите несколько сеансов с одним и тем же пользователем, я думаю Ivan Viktorovic 8 лет назад 0
Я вхожу на текущий активный пользователь. Он по-прежнему предоставляет им экран блокировки, как только я вхожу в систему. Протестировано на двух компьютерах, расположенных рядом друг с другом, поэтому визуальный осмотр с обеих сторон прост. С тех пор, возможно, XP, определенно 7 и продолжается 10. Я хотел бы иметь возможность делать это в интерактивном режиме, как я могу с помощью удаленного рабочего стола Apple или даже TeamViewer. Tetsujin 8 лет назад 0
Любопытно узнать, какую ошибку выдают эти 2 команды (tscon.exe 0 / dest: console tscon.exe 1 / dest: console), так как это то, что я использую ежедневно. IronWilliamCash 7 лет назад 0

3 ответа на вопрос

5
Pimp Juice IT

Okay, so a few things after reading your question and some of the comments and your comments back and forth to and from others. I'm going to post some details and then a potential solution at the bottom that I've confirmed worked fine in a test/lab environment a while back, but I encourage you to read over my answer entirely as there are some gotchas, etc.

  1. How to stop remote desktop logoff after closing the connection

    For this question above, others have answered and suggested the GPO settings (idle and disconnected session time limits to unlimited) to look over and ensuring that the user disconnects rather than logoff.

  2. I am logging to the currently active user. It still presents them with the lock-screen as soon as I log in. Tested on 2 comps physically next to each other, so visual examination from both sides is simple. This has been since possibly XP, definitely 7 & continues on 10. I'd love to be able to do it interactively, like I can with Apple's Remote Desktop or even TeamViewer.

    a. Using TeamViewer on Windows will still not allow multiple or concurrent RDP sessions on a Windows non-Server OS. It will allow you to interact with currently exisitng RDP sessions or active console sessions only so if you do not have more than one of those to connect to for interacting with, it'll not give you the expected result.

    b. Microsoft sells Server OSes and Client Access Licenses for Terminal Server access with a cost associated per user or per device CAL as I've seen others mention in comments, answers, etc. So for Microsoft non-Server OSes, they leave this Terminal Server RDP expanded functionality not enabled or disabled for that reason for one.

    c. Microsoft Server OSes usually can handle more concurrent sessions more effecient on the same machine with more memory support, and not having as much (non-Server bloatware type) Microsoft built-in features and functions enabled by default as non-Server OSes may have to ensure optimum performance so these unnecessary things just don't run. On a home PC more people may legitimately use these features and find them more useful than on a server in this type of environment for non-home (or client workstation) usage. On a server though, these may not be needed as much so I'd consider these bloatware more in the server OS context just to clarify what I mean here by the term "bloatware" in this particular instance.


The Potential Workaround

Warning: I'd suggest doing this in only a test or lab environment for testing purposes only a I'd never suggest using it for production purposes in a business environment. Otherwise, use with caution at your own risk as I have no idea about the legalities of usign this long-term otherwise for production purposes, etc.

Below is a link to a source called RDPWrap that's on GITHub that's a free download. They've posted full instructions with screen shots, etc. on the site with step-by-step detail so it shouldn't be too difficult to figure out.

To download what you'll need that's the actual install file rather than the non-compiled source code, from the below link named RDPWrap Install File Download Link in the in the Download section of that page, click on the link named RDPWrap-v1.6.zip to download the EXE and batch install files, etc. contained within this ZIP file (see below screen shot).

Gotchas

If you apply Windows Updates on one of your test machines and this functionality ends up not working afterwards, you may need to run the install again to patch over the files, etc. You may also need to check the source GITHub resources for other bug patches, etc. with new releases since this is something someone else provides.


Important: Domain level Group Policy and/or Security Policy settings may override all the below listed local Registry, local Group Policy, and local Security Policy settings. From what I can tell but not confirm myself, ensuring these settings are set as specified will prevent disconnected RDP sessions from being logged off after a certain period of time. You may need to reboot the machine after making any local settings changed below for those to become effective. You may need to check for domain level Group Policy or Security Policy settings that take precedence over the local settings if you still have trouble after ensuring these settings are set locally per machine.



Concurrent RDP Session Same User Account Registry Values

Change these registry values as shown in the screen shot to enable or disable the ability to allow more than one concurrent RDP session with the SAME account. You'll need to change and/or create this key manually perhaps and set per each run of the RDPWrap patch software on your test systems.

To change this setting, you'll need to perform a registry change. The following steps describe the process:

  1. Start Registry Editor (by default, this is located at c:\windows\regedit.exe).
  2. Go to the following registry key:

    HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\TerminalServer

  3. If the fSingleSessionPerUser value doesn't exist, create a new DWORD value named fSingleSessionPerUser

  4. Open the fSingleSessionPerUser value. The possible values for this setting are as follows:

    0x0

    Allow multiple sessions per user

    0x1

    Force each user to a single session

  5. Enter the new setting, and then click OK.


Ensure Disconnected RDP Sessions aren't Logged Off Automatically

A. From GPEDIT.MSC ALL the below settings in both Computer Configuration and User Configuration need to be set to a State of Not configured.

These Group Policy settings are located in the following locations:

  • Computer Configuration\Policies\Administrative Templates\Windows Components\Remote Desktop Services\Remote Desktop Session Host\Session Time Limits
  • User Configuration\Policies\Administrative Templates\Windows Components\Remote Desktop Services\Remote Desktop Session Host\Session Time Limits

enter image description here


From Community Spiceworks Comment

B. From SECPOL.MSC the below (screen shot highlighted) setting in Interactive logon: Do not require CTRL+ALT+DEL needs to be set to a Enabled.

1. Local Policies\Security Options

enter image description here


Download Link Screen Shot

enter image description here


Sources:

Вот Это Да! Основная деталь. Позвольте мне впитать это завтра [немного поздно здесь и сейчас], и я дам вам знать. Спасибо, что уделили столько времени этому. Tetsujin 8 лет назад 1
Здорово, что несколько человек могут получить доступ без отключения. PKSA 8 лет назад 0
Но мне нужно, чтобы при нажатии кнопки «Закрыть» система не выходила из системы. Но это выход из системы. PKSA 8 лет назад 0
@LMFAO_A_JOKE Я пробовал это, но это не решило мою проблему. Это позволяет машине устанавливать 2 соединения, но они не могут видеть одну и ту же страницу, как мы можем это сделать в TeamViewer или VNC и т. Д. Кроме того, моя проблема заключалась в том, что я был единственным, кто подключился к машине, и я отключил свою машину RDC машина не должна выходить из системы PKSA 8 лет назад 0
@PKSA Хорошо, именно так Microsoft разработала функцию RDP, которая позволяет вам использовать ее, к сожалению, поэтому, используя встроенную функциональность Windows RDP, вы не можете просматривать общий доступ, насколько мне известно. Это решение позволяет проводить несколько одновременных сеансов RDP одной и той же или отдельными учетными записями пользователей, не сталкиваясь с другими, поэтому по существу ОС Windows для настольных компьютеров ведет себя как сервер терминалов с установленным набором политик. Так PKSA и Tetsujin это один и тот же человек или что? Я не уверен, почему я не видел и не отвечал на это еще в январе 2016 года, но у вас это есть. Pimp Juice IT 6 лет назад 0
У меня проблема с Google Cloud VM. Я хочу, чтобы рабочий стол продолжал работать даже без RDP, подключенного к виртуальной машине (поэтому я смогу запускать настольные приложения). Поможет ли кто-нибудь из них? Royi 6 лет назад 0
Я хочу запустить программу с пользовательским интерфейсом, не будучи на RDP. Royi 6 лет назад 0
@Royi И я подозреваю, что у этого интерфейса нет эквивалентного CLI, который вы могли бы написать, правильно? В прошлом я имел успех с такими операциями, использующими AutoIT, где не было абсолютно никакого другого пути с CLI или каким-либо сценарием приложения. Какая программа это случайно, стандартная программа или, может быть, какое-то собственное приложение или что-то еще? Вы когда-нибудь использовали БЕСПЛАТНОЕ программное обеспечение [AutoIT] (https://www.autoitscript.com/site/autoit/)? Pimp Juice IT 6 лет назад 0
1
Fazer87

это может быть вызвано групповой политикой или локальной политикой безопасности на вашем локальном компьютере. Шаги, чтобы исправить это в обоих случаях, похожи:

  • Запустите редактор локальных групповых политик: https://technet.microsoft.com/en-us/library/cc754685.aspx (старт> окно поиска> gpedit.msc) (для пользователей домена, запустите управление групповыми политиками, перейдите на свои серверы И редактировать объект групповой политики)

  • Перейдите к следующему параметру GP: Конфигурация компьютера> Административные шаблоны> Компоненты Windows> Службы удаленных рабочих столов> Узел сеансов удаленных рабочих столов> Ограничения времени сеанса - при наличии убедитесь, что вы установили неограниченное время простоя и время отключенного сеанса.

Перезагрузите ваши машины.

Попробуйте выполнить это на обоих ПК (скорее всего, на том, к которому вы подключаетесь RDP) и посмотрите, как вы попали.

1
Rohan Gala

To disconnect without ending your Remote Desktop session You can temporarily disconnect from a session by clicking the Close button on the connection bar (the horizontal bar at the top of your screen). This leaves your programs running so that, next time you connect, you can continue where you left off.

Even this may help https://technet.microsoft.com/en-in/library/cc754272.aspx

Я начинаю думать, что я действительно задал неправильный вопрос. Моя главная проблема в том, что пользователь на другом конце вышел из системы. Я могу подключиться через секунду из моей коллекции «закладок», но другой пользователь остается просто пристально глядеть на экран входа в систему все время, пока я там, и также не знает, когда я закончил. Я почти испытываю желание просто переключиться на TeamViewer, если RDC не может этого сделать :( Tetsujin 8 лет назад 0

Похожие вопросы