?
Solved

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

Posted on 2010-08-31
3
Medium Priority
?
1,125 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 2000 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

Office 365 Training for IT Pros

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

Question has a verified solution.

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

Remote Apps is a feature in server 2008 which allows users to run applications off Remote Desktop Servers without having to log into them to run the applications.  The user can either have a desktop shortcut installed or go through the web portal to…
On July 14th 2015, Windows Server 2003 will become End of Support, leaving hundreds of thousands of servers around the world that still run this 12 year old operating system vulnerable and potentially out of compliance in many organisations around t…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

777 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