Windows 7 / Getting Started

Closing Unresponsive Applications

If a user's application stalls, one way to handle the problem is to stop the process for that application. How you do this depends on whether you want to stop all instances of that process on the RD Session Host server or just the one that's causing trouble.

In this scenario, the user's application is not responding. You must terminate the process associated with the application. If you have a farm, first you will need to find out which server hosts the user session.

Do this by opening the Remote Desktop Services Manager and adding the servers for an RD Connection Broker farm. Then, for each server, click the Users tab and find the user. If you have not limited users to one session, then you will need to check all servers and find all sessions the user might have established. After you know all the places the user is connected, you must locate the stalled application.

How simple this is depends on your policies on having multiple sessions. If you support only one session per user, then all you need to do is click the Processes tab on the server that hosts the user session containing the stalled application, sort by Image, find the process associated with the user and the stalled application, right-click anywhere in the line entry, and choose End Process. If your user has multiple sessions, then you need to check the processes on each server, locate the specific server and user session in which the process is running, and terminate the process.

You can also accomplish all this from the command line. In this example, magy.ryan, a user in the ash.localdomain, has been running the Excel RemoteApp. It has become unresponsive and needs to be terminated. This domain has a server farm and limits users to one session at a time.

First, you need to locate the server that hosts magy.ryan's session. Run the qprocess command against every server in the farm until you find magy.ryan.

C:\windows\system32>qprocess excel.exe /server:bigfrog
USERNAME 	SESSIONNAME 	ID 	PID  IMAGE
mik.noch 	rdp-tcp#1 	4 	2720 excel.exe
zen.laik 	rdp-tcp#2 	5 	3228 excel.exe

C:\windows\system32>qprocess excel.exe /server:FUJI
USERNAME 	SESSIONNAME 	ID 	PID  IMAGE
magy.ryan 	rdp-tcp#1 	4 	2776 excel.exe
arth.jimy 	rdp-tcp#3 	5 	3392 excel.exe
robert.nelson 	rdp-tcp#4 	6 	3532 excel.exe

Now stop the Excel.exe process associated with magy.ryan. Do this by specifying the PID associated with the process shown in the preceding query.

C:\windows\system32>tskill 2776 /server:FUJI
NOTE: You can also specify the process by using the session ID and process name switches. Refer to the section entitled "Monitoring and Terminating Processes" earlier in this tutorial for other examples of terminating processes.

If other users also complain, and it is apparent that all instances of Excel are stalled, you can terminate them all by running tskill, but use the processname parameter (the image name minus the executable extension) and the switch /A (which tells tskill to kill all instances of the processname).

C:\windows\system32>tskill excel /server:FUJI /A

Then run qprocess again and see that there are no longer any instances of Excel.exe running.

C:\windows\system32>qprocess excel.exe /server:FUJI
No Process exists for excel.exe
[Previous] [Contents]