- Make sure you’re authenticated with remote Windows PC. A simple method is to use NET USE:
C:> net use /user:Administrator \\REMOTEPC\C$ - Enter in the Administrator password when prompted and press Enter.
- In the Command Prompt, run the following command:
C:> qwinsta /server:REMOTEPC - A list of active and connected Remote Desktop sessions will be displayed. Find the ‘hanging’ connection and its “ID”.
- To disconnect and reset the Remote Desktop connection(s) or session(s), use the following command:
C:> rwinsta ID /server:REMOTEPC
For example, if you want to reset the session of “accounting_user1” with a session ID of “35” on the “MYDC” server, you would use the following command:
C:> rwinsta 35 /server:MYDC - With the RDP session ended, you can now connect to the open slot.
qwinsta is short for “Query Window Station”, and rwinsta is short for “Reset Window Station”.