Solved

Detecting If A Terminal Services Session Is Left Disconnected

Posted on 2010-11-16
3
622 Views
Last Modified: 2012-05-10
Hello experts

Im looking for a method to detect when a terminal server session has been left disconnected for x minutes and to perform an action. Bascially we need to keep track of disconnected sessions and then force them closed (Closing a session is easy enough through the settings for the terminal server). My ultimate goal is to basically deny people access to the server if they leave a session disconnected x times. Server we are using is 2003 r2 server. Has anybody done anything like this before ?
0
Comment
Question by:Porka
[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
3 Comments
 
LVL 3

Accepted Solution

by:
RussPitcher earned 250 total points
ID: 34144614
It should be fairly simple to use the 'query session' command with a bit of PowerShell or VBscript to parse the output.  Off the top of my head if you spot a user with a disconnected session you could save a text file named with their username and write a '1' to it.  If the file already exists then just increment the number.  You could also issue a 'logoff session xx' command to boot them off at the same time.  After the number gets to the level of your choice then send an e-mail to the admin to block them, or the user to nag them.  You could also have a 'reset' period - if the file hasn't been updated for Y days then it gets deleted and the slate is wiped clean - if you are feeling generous :)
0
 
LVL 8

Assisted Solution

by:GundogTrainer
GundogTrainer earned 250 total points
ID: 34145611
There is a good starting script on EE already to kill disconnected sessions:

http://www.experts-exchange.com/Programming/Languages/Visual_Basic/Q_21183183.html?qid=21183183

Just looking at how it could be adapted to meet your requirements.
0
 
LVL 6

Author Comment

by:Porka
ID: 35004569
Sorry for delay guys. I ended up modifying gundogtrainers vbs link to do the job but used russpitchers idea of a text file which a number that increments so I split to the points based on that. Thanks for all the help
0

Featured Post

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

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

Remote Desktop Connections allow you to control remote host machines via the magic of the Internet and RDP (Remote Desktop Protocol). For the purposes of this article we will assume you are connecting from your home PC or laptop to a remote offic…
Remote Desktop Shadowing often has a lot of benefits. When helping end users determine problems, it is much easier to see what is going on, what is being slecected and what is being clicked on. While the industry has many products to help with this,…
How to install and configure Citrix XenApp 6.5 - Part 1. In this video tutorial we have explained step by step installation of Citrix XenApp 6.5 Server on Windows Server 2008 R2 is explained in this video. We have explained the difference between…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

739 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