I need some script to be able to kill terminal sessions in our server.
Basically, some users are connecting through an application via Terminal Services. When they close the application, it usually triggers the disconnection and closure of the Terminal Services.
On some occasions, the users instead of closing the application, closes the terminal service. This leaves the terminal session hanging since the application is still running.
Is there a script available which would be able to detect those hanging terminal services, including the application which is running inside it?
Appreciate any help on this. Thanks.