Solved

Detecting If A Terminal Services Session Is Left Disconnected

Posted on 2010-11-16
3
623 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:Jarrod
[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:Jarrod
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

What Is Blockchain Technology?

Blockchain is a technology that underpins the success of Bitcoin and other digital currencies, but it has uses far beyond finance. Learn how blockchain works and why it is proving disruptive to other areas of IT.

Question has a verified solution.

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

Many of us need to configure DHCP server(s) in their environment. We can do that simply via DHCP console on server or using MMC snap-in on each computer with Administrative Tools installed in a network. But what if we have to configure many DHCP ser…
ADCs have gained traction within the last decade, largely due to increased demand for legacy load balancing appliances to handle more advanced application delivery requirements and improve application performance.
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…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

636 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