We have a Windows Server 2012 / Windows 10 client domain environment. Our terminal server has various Remote Apps published and deployed to the end users machines.<\/p>\n
Advertisement
Sometimes a user’s session freezes up and it needs forcefully disconnected, because simply closing the window and re-launching the remote app will just resume their frozen session.<\/p>\n
Advertisement
So, we will log into the terminal server, open task manager, find the user, right click and Logoff to force kill their session.<\/p>\n
I’d like to know if there is a script the users themselves can run to perform this same action…force kill their own Remote app session. This will free up our time and the user’s time if they can just do it themselves.<\/p>\n
I’ve been trying to come up with something using qwinsta, but whatever I try will not work.<\/p>\n
I was thinking I need to query the sessions on the terminal server (Server-TS)…somehow match the session with the current logged on user for that computer (perhaps %username% would work?)…funnel that session information to a variable…and then use some kind of kill/disconnect command to force close it.<\/p>\n
Again, the goal is to allow a user on their own workstation the ability to force kill their own Remote App sessions so that an administrator doesn’t have to log into the terminal server, go into task manager, etc etc. each time an app freezes or glitches up.<\/p>\n
Any help would be greatly appreciated!!!<\/p>","upvoteCount":3,"answerCount":11,"datePublished":"2021-02-18T16:35:13.000Z","author":{"@type":"Person","name":"spiceuser-e0xy7","url":"https://community.spiceworks.com/u/spiceuser-e0xy7"},"suggestedAnswer":[{"@type":"Answer","text":"
We have a Windows Server 2012 / Windows 10 client domain environment. Our terminal server has various Remote Apps published and deployed to the end users machines.<\/p>\n
Sometimes a user’s session freezes up and it needs forcefully disconnected, because simply closing the window and re-launching the remote app will just resume their frozen session.<\/p>\n
So, we will log into the terminal server, open task manager, find the user, right click and Logoff to force kill their session.<\/p>\n
I’d like to know if there is a script the users themselves can run to perform this same action…force kill their own Remote app session. This will free up our time and the user’s time if they can just do it themselves.<\/p>\n
I’ve been trying to come up with something using qwinsta, but whatever I try will not work.<\/p>\n
I was thinking I need to query the sessions on the terminal server (Server-TS)…somehow match the session with the current logged on user for that computer (perhaps %username% would work?)…funnel that session information to a variable…and then use some kind of kill/disconnect command to force close it.<\/p>\n
Again, the goal is to allow a user on their own workstation the ability to force kill their own Remote App sessions so that an administrator doesn’t have to log into the terminal server, go into task manager, etc etc. each time an app freezes or glitches up.<\/p>\n
Any help would be greatly appreciated!!!<\/p>","upvoteCount":3,"datePublished":"2021-02-18T16:35:13.000Z","url":"https://community.spiceworks.com/t/enable-user-to-kill-their-own-rd-session/791164/1","author":{"@type":"Person","name":"spiceuser-e0xy7","url":"https://community.spiceworks.com/u/spiceuser-e0xy7"}},{"@type":"Answer","text":"
Users should not have the access rights needed to kill a session on the server.<\/p>\n
Your idea of querying and scripting might work for your admins so it will be easier for them to kill a session.<\/p>","upvoteCount":1,"datePublished":"2021-02-18T16:38:31.000Z","url":"https://community.spiceworks.com/t/enable-user-to-kill-their-own-rd-session/791164/2","author":{"@type":"Person","name":"DragonsRule","url":"https://community.spiceworks.com/u/DragonsRule"}},{"@type":"Answer","text":"
The way this script would be launched would be through a program…they will NOT be able to see the script that’s running. \nWith that being said, is there a way to run a command which authenticates to the terminal server with administrator credentials that DOES have rights to kill sessions on that server…and then kill the session that matches the currently logged on user on that computer?<\/p>","upvoteCount":0,"datePublished":"2021-02-18T16:41:37.000Z","url":"https://community.spiceworks.com/t/enable-user-to-kill-their-own-rd-session/791164/3","author":{"@type":"Person","name":"spiceuser-e0xy7","url":"https://community.spiceworks.com/u/spiceuser-e0xy7"}},{"@type":"Answer","text":"