Solved

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

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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

This is my 3rd article on SCCM in recent weeks, the 1st (http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/Server/Windows_Server_2008/A_4466-A-beginners-guide-to-installing-SCCM2007-on-Windows-2008-R2-Server.html) dealing with installat…
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…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

773 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