Manjish Posted January 16, 2009 Share Posted January 16, 2009 Well, I wanted to develop a script in which i can present to a user the remote desktop clients connected using "mstsc" to a particular server. Then looking at the time since which a particular client has been idle, the user can disconnect that client. Now this user has admin rights, and all necessary permissions to disconnect any1, query the server users etc. The problem we face here is that ppl minimize the rdp windows and forget to disconnect them, because of which other users who need to connect to server cannot, as the connections have reached their limit. Hence any1 sitting anywhere can query this info from the server, and decide which 1 to disconnect. I tried "net session" cmd, but it doesn't differentiate betwn remote dektop and remote folder share, and I dnt want to disconnect remote folder shares, as ppl my really need them. Please some1 help me. If there's a cmd to do this from cmd prompt, please tell me about it. Or if there is a way to access the info from the task manager's "users" tab, without disturbing the server, and running in background. I have the framewok ready, just need to work out this problem. Thanks. [font="Garamond"]Manjish Naik[/font]Engineer, Global Services - QPSHoneywell Automation India LimitedE-mail - Manjish.Naik@honeywell.com Link to comment Share on other sites More sharing options...
maqleod Posted January 16, 2009 Share Posted January 16, 2009 TSDISCON.exe and query.exe, windows XP should have it in the system32 and system32/dllcache folders respectivelyWell, I wanted to develop a script in which i can present to a user the remote desktop clients connected using "mstsc" to a particular server. Then looking at the time since which a particular client has been idle, the user can disconnect that client. Now this user has admin rights, and all necessary permissions to disconnect any1, query the server users etc.The problem we face here is that ppl minimize the rdp windows and forget to disconnect them, because of which other users who need to connect to server cannot, as the connections have reached their limit. Hence any1 sitting anywhere can query this info from the server, and decide which 1 to disconnect. I tried "net session" cmd, but it doesn't differentiate betwn remote dektop and remote folder share, and I dnt want to disconnect remote folder shares, as ppl my really need them. Please some1 help me. If there's a cmd to do this from cmd prompt, please tell me about it. Or if there is a way to access the info from the task manager's "users" tab, without disturbing the server, and running in background.I have the framewok ready, just need to work out this problem. Thanks. [u]You can download my projects at:[/u] Pulsar Software Link to comment Share on other sites More sharing options...
Manjish Posted January 16, 2009 Author Share Posted January 16, 2009 TSDISCON.exe and query.exe, windows XP should have it in the system32 and system32/dllcache folders respectivelyHey tsdiscon.exe locks the computer, doesn't logoff, it doesnt disconnect the rdp session. Also i tried query user.. it doesn't give what i want.. Please can u tell me exactly how u want me use it. Whats in ur mind. Bdw, thanks for such a prompt reply [font="Garamond"]Manjish Naik[/font]Engineer, Global Services - QPSHoneywell Automation India LimitedE-mail - Manjish.Naik@honeywell.com Link to comment Share on other sites More sharing options...
maqleod Posted January 16, 2009 Share Posted January 16, 2009 Hey tsdiscon.exe locks the computer, doesn't logoff, it doesnt disconnect the rdp session. Also i tried query user.. it doesn't give what i want.. Please can u tell me exactly how u want me use it. Whats in ur mind. Bdw, thanks for such a prompt replyquery.exe from the microsoft website:Query user displays information about user sessions on a terminal server. You can use this command to find out if a specific user is logged on to a specific terminal server. Query user returns the following information: * The name of the user * The name of the session on the terminal server * The session ID * The state of the session (active or disconnected) * The idle time (the number of minutes since the last keystroke or mouse movement at the session) * The date and time the user logged onIf you use query user without specifying a user name, session name, or session ID, a list of all users who are logged on to the server is returned. Alternatively, you can also use query session to display a list of all sessions on a server.It will give you all the users, you can put that into a listview and then you can select a user to get more information or to take an action, such as disconnect.tdiscon.exe from the microsoft website:Tsdiscon disconnects a session from a terminal server. You must have Full Control permission to disconnect another user from a session.If no session ID or session name is specified, tsdiscon disconnects the current session. The console session cannot be disconnected. [u]You can download my projects at:[/u] Pulsar Software Link to comment Share on other sites More sharing options...
maqleod Posted January 16, 2009 Share Posted January 16, 2009 alternatively, you can just set a group policy to set a time limit for active but idle sessions so they are disconnected after they are idle too long. That would really be the easiest. [u]You can download my projects at:[/u] Pulsar Software Link to comment Share on other sites More sharing options...
Manjish Posted January 16, 2009 Author Share Posted January 16, 2009 alternatively, you can just set a group policy to set a time limit for active but idle sessions so they are disconnected after they are idle too long. That would really be the easiest.Perfect!!!Just what i needed. But it could have been cool if along with the username, i could see the computername. Coz here all comps have the same username.But still i can use this. Awesome man, thanks a lot [font="Garamond"]Manjish Naik[/font]Engineer, Global Services - QPSHoneywell Automation India LimitedE-mail - Manjish.Naik@honeywell.com Link to comment Share on other sites More sharing options...
Manjish Posted January 16, 2009 Author Share Posted January 16, 2009 do u know of method to get the computer name too?? [font="Garamond"]Manjish Naik[/font]Engineer, Global Services - QPSHoneywell Automation India LimitedE-mail - Manjish.Naik@honeywell.com Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now