Solved

Remote Desktop connection via batch file won't disconnect after session

Posted on 2010-08-31
3
1,118 Views
Last Modified: 2013-11-21
I run a scheduled task each night on my server (2003) box which opens an RDP session with another remote server (2003).  The session opens a batch file on connection that loads several databases to the remote server.  Usually once everything has been loaded up, the session ends and it disconnects automatically, but lately I will get to work in the morning and the RDP window will still be open.  It will allow me to log back in, but I cannot see anything but a window with a blue background and I am forced to close it.  This of course tells me that the session is still active and my programs will continue running until I log back in again.  However it won't let me log back in because "I have exceeded the max number of terminal server connections"  ... I have figured out that I can log in via console (mstc /console) but that isn't a solution.

Anybody have an idea why my session won't disconnect automatically anymore?  The weird thing is if I run that same rdp session at work watching it, it seems to work.

Max
0
Comment
Question by:MaxwellTurner
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 15

Accepted Solution

by:
Dave_AND earned 500 total points
ID: 33572004
Not 100% sure but why not set the maximum Idle time for TS sessions so it will automatically disconnect sessions that have been open too long?
0
 
LVL 1

Author Comment

by:MaxwellTurner
ID: 33572128
Thanks Dave,

What I ended up doing is adding this to the end of my batch file:

%windir%\System32\tscon.exe 0 /dest:console

but I am thinking the problem is that the session is simply timing out (the databases are get bigger and bigger all the time) so I also chose to override user settings (Terminal services configuration, rdp-tdp properties, session tab) on the remote computer.  I set "end disconnected session" to 5 minutes, "max active and idle session" to 1 hour ... the dbase upload only takes 30-40 minutes and that is the only rdp connection to that server, so I think I should be safe with those settings.

Max
0
 
LVL 1

Author Closing Comment

by:MaxwellTurner
ID: 33649237
Thanks Dave,  that seems to have worked.
0

Featured Post

Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Welcome to my series of short tips on migrations. Whilst based on Microsoft migrations the same principles can be applied to any type of migration. My first tip Migration Tip #1 – Source Server Health can be found listed in my profile here: http:…
Welcome to my series of short tips on migrations. Whilst based on Microsoft migrations the same principles can be applied to any type of migration. My first tip Migration Tip #1 – Source Server Health can be found here: http://www.experts-exchang…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question