On the session host, first I run query session to get a list of session IDs.
Then run query process /ID:XX where XX is the session ID number to find processes running in the session.
Then go to task manager and click the details tab look up the PID (process ID) and 'end task' on each process in the stuck session until it logs off.