Solved

Detecting If A Terminal Services Session Is Left Disconnected

Posted on 2010-11-16
3
616 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
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

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

Suggested Solutions

Numerous times I have been asked this questions that what is it that makes my machine log on so slow, there have been cases where computers took 23 minute exactly after taking password and getting to the desktop. Interesting thing was the fact th…
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…
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…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

743 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

11 Experts available now in Live!

Get 1:1 Help Now