Solved

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

Posted on 2010-08-31
3
1,121 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

Enroll in June's Course of the Month

June's Course of the Month is now available! Every 10 seconds, a consumer gets hit with ransomware. Refresh your knowledge of ransomware best practices by enrolling in this month's complimentary course for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

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

Setting up a Microsoft WSUS update system is free relatively speaking if you have hard disk space and processor capacity.   However, WSUS can be a blessing and a curse. For example, there is nothing worse than approving updates and they just have…
A quick step-by-step overview of installing and configuring Carbonite Server Backup.
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

717 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