I'm trying to manage user's RDP session at Windows Server 2003. I have one Windows host. This host runs several user sessions.
c:>qwinsta
SESSIONNAME USERNAME ID STATE TYPE DEVICE
>console Administrator 0 Active wdcon
rdp-tcp 65536 Listen rdpwd
rdp-tcp#1 test1 1 Active rdpwd
rdp-tcp#2 test2 2 Active rdpwd
Sometimes I need to close user's session and open it from the scratch.
RWinsta %sessionID%
command works fine - user session is closed.
but I still have mstsc.exe process running and an opened window with the information "the remote session was disconnected because your session was logged off at the remote computer"
How could I close not only user session but mstsc process also? Thank you.
Try below code and check if it works :
Try more options according to your requirement ,
Try
taskkill /?