Alan's Blog

"Yeah. I wrote a script that will do that."

Find and Reset RDP Sessions

Posted on October 24th, 2011

We have a lot of servers. When I get disconnected, I may leave hanging sessions on those servers which I forget to properly close. Then, after I change the password for my admin account, I sometimes get locked out as a result of what I had open in the now disconnected session. Tracking this down is always annoying and time consuming. When users (including administrators) are terminated, a there is a similar problem — you want to find and reset those sessions, too. ServerSessions.vbs is a script for admins to run to track down sessions on servers and optionally reset them. You can list sessions on all servers in a domain, and reset either all or just disconnected sessions. I have scripts for finding users, too.  LocateUsers.vbs finds a user based on their home drive sessions.

Tags:
Filed under Security, VbScript, Windows Administration | 2 Comments »

Please Note

All the scripts are saved as .txt files. Newer files have a "View Script" button which will let you save or open a script in notepad. For earlier posts, the easiest way to download with IE is to right click on the link and use "Save Target As". Rename file from Name_ext.txt to Name.ext.

To see a full post after searching, please click on the title.

PowerShell Scripts were written with Version 3 or 4.

https connections are supported.

All new users accounts must be approved, as are comments. Please be patient. It is pretty easy to figure out my email address from the scripts, and you are welcome to contact me that way.

Site Search

Categories

Archives

SQL Site

Bad Behavior has blocked 169 access attempts in the last 7 days.