A Remote Desktop or RemoteApp session does not terminate due to a spawned process. RemoteDesktopServices 2008R2+ is affected. This behavior is documented in the following Microsoft article:
These trailing processes can prevent disconnection from the Parallels Client.
Adding the incriminating process to the SysProcs key on your RDS server should allow a graceful disconnect or logoff from a session.
Follow these steps to add the process to the SvsProcs key:
- Click Start, select Run, type regedit in the Open box, and then click OK.
- Locate the following registry key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\SysProcs.
- Right-click the SysProcs, hover your cursor over New, and then click DWORD Value.
- Type the name of the process in the Name box, and then press Enter.
- Double-click the DWORD created to open the Edit DWORD Value box.
- If the DWORD value is anything other than 0, change the value to 0, and then click OK. If the DWORD value is 0, click Cancel.
Please refer to the following blog post on Terminal Services RemoteApp™ Session Termination Logic for more details on the solution: