Solved

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

Posted on 2010-08-31
3
1,102 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
Comment Utility
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
Comment Utility
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
Comment Utility
Thanks Dave,  that seems to have worked.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

My previous article  (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)detailed one possible method to get SCCM 2007 installed an…
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…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

762 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now