In command prompt, execute following commands to kill terminal services sessions remotely. Replace blue with your own parameters.
Step 1. Gain enough privilidge to kill RDP connection on the server.
net use \\servername_or_IP /USER:username “password“
Step 2. List the connection to a particular server and get session ID.
query session /server:servername
Step 3. Reset the session which you don’t need using ID of the session from Step 2.
reset session ID /server:servername_or_IP
That’s it! However it seems that on some machines, query.exe and reset.exe are not available. If that’s the case, try qwinsta.exe and rwinsta.exe respectivly in place of query.exe and reset.exe. Alternatively, you should be able to find query.exe and reset.exe in “C:\WINDOWS\System32\dllcache“. Copy the files to System32 directory and you are good to go.
Ex:
step 1:
net use \\120.130.12.4 /USER:administrator gjhsd71
step 2:
query session /server:120.130.12.4
you will get result like this....session id is 1 here
SESSIONNAME USERNAME ID STATE TYPE DEVICE
-----------------------------------------------------------------------------
console Administrator 1 Active
step 3:
reset session 1 /server:120.130.12.4