12

I connecting remotely using remote desktop to windows 7 client when i disconnect the session it automatically logged-out the user in the remote client. I want to keep the user logged-in on the remote client after i close the RDP session.

Thanks in advance

alonp
  • 223
  • 1
  • 2
  • 5

2 Answers2

12

I think this would work, connect from the remote machine with the /admin option like so...

mstsc /v:windows7machine /admin

And then when you go to disconnect, you can run this command from the client to keep the session alive and redirect the session to the console...

tscon 1 /dest:console

[EDIT] I should add, this is kind of a trick for managing a HTPC through RDP, since you can login through RDP (hiding the desktop locally), queue and start a movie, then disconnect the RDP session while redirecting it's output to the local display (unhiding the desktop locally).

UPDATE
If it's an Active Directory environment, check to make sure the option End a disconnected session isn't checked under properties for the affected user in ADUC.

CurtM
  • 2,960
  • 1
  • 17
  • 11
  • As i understand the second command should be executed on windows 7 machine: but i got this error SessionID 1 not found, the same is on the local machine – alonp Nov 25 '10 at 07:57
  • 1
    Run the command `query session` and replace the number 1 with the ID of the appropriate active session. – CurtM Nov 25 '10 at 08:04
  • Several good command line answers have been posted here: https://superuser.com/questions/303927/how-can-i-retrieve-the-session-id-from-command-line – JonathanDavidArndt Sep 01 '17 at 16:27
  • @CurtM Hello, does this work if we want to maintain a running GUI application after disconnect? – Vesnog Jun 06 '18 at 22:08
1

No way.

Here is the trick: Under normal conditions Win7 does not log you out when you just close the remote desktop client. The session keeps open. I am currently in about 4 or 5 remote sessions with this mechanism, most "not active" in that there is no client connected.

So, basically, the admin has confiogured it so that this happens. This means actually that you bypassing it is hard, and in addition a violation of your corporate policy.

TomTom
  • 51,649
  • 7
  • 54
  • 136