A Remote Desktop session can get stuck: the screen freezes, a disconnected session keeps holding one of the server's slots, or Windows tells you another user is already connected. The fix is to sign that session out from a working session or from the server console. This guide shows the commands and the graphical way to do it.
Before you start
- A Windows VPS (Windows Server 2019, 2022 or 2025) or an Admin RDP desktop.
- An administrator account. Connect as usual on
203.0.113.10:3389. - If you cannot connect at all, use the browser console from your VPS provider's control panel. It reaches the server's local console without Remote Desktop.
Warning: Signing out a session closes every program in it without saving. If someone else owns that session, warn them first. If it is your own stuck session, accept that unsaved work in it will be lost.
List the sessions
From any working session, or from the browser console, open Command Prompt or PowerShell and run:
quserExample output:
USERNAME SESSIONNAME ID STATE IDLE TIME LOGON TIME
>admin rdp-tcp#7 2 Active . 11/9/2026 10:15 AM
deploy 3 Disc 2:40 11/9/2026 7:31 AM- ID is the number you need for the next step.
- Disc means disconnected: the session is still running, but no one is attached.
- The
>marks the session you are using now. Do not sign that one out by mistake.
For a fuller list that also shows the console and listener sessions, use:
query sessionSign out a session by ID
To sign out session 3:
logoff 3Windows closes the session and its programs. Run quser again and the line should be gone.
If logoff hangs or the session stays in the list, force a reset:
reset session 3reset session (also available as rwinsta) tears the session down without waiting for programs to close cleanly. Use it only when logoff fails.
Tip: Add /v to logoff to see a confirmation message, for example logoff 3 /v.
Use Task Manager instead
If you prefer a graphical tool:
- Right-click the taskbar and choose Task Manager, or press Ctrl + Shift + Esc.
- Click More details if it opens in the small view.
- Open the Users tab.
- Right-click the stuck user and choose Sign off. Choose Disconnect instead if you only want to free the connection and keep their programs running.
On an Admin RDP desktop running Windows 10/11, only one person can use the desktop at a time, so the Users tab normally shows just your own account and any session left at the local console.
When RDP says another user is connected
On Windows Server, without the Session Host role, only two remote sessions can run at once. When both are taken, you see a prompt asking you to disconnect another user.
- If you can connect as an administrator, accept the prompt to disconnect one user, then sign out the old session with
logoff. - If you cannot get past the prompt, open the browser console from your VPS provider's control panel, sign in, and run
quserandlogoffthere. - As a last resort, restart the server from your VPS provider's control panel. A restart ends every session.
Warning: A restart closes all programs for all users and can interrupt running jobs or open trades. Use it only when the commands above do not work.
Check it works
- Run
quserand confirm the stuck session is no longer listed. - Connect from your PC to
203.0.113.10:3389. - You should get a fresh desktop, without a prompt about other users.
Troubleshooting
- "Error 5 getting session names" or access denied: your prompt is not elevated or your account is not an administrator. Open Command Prompt with Run as administrator.
- The session comes back as soon as you sign it out: a program or script is reconnecting with saved credentials. Check other PCs and connection tools that use that account.
- *
qusershows "No User exists for \":** no one is signed in. The problem is elsewhere, such as the network or the port. See Fix "Remote Desktop can't connect to the remote computer". - Sessions keep piling up in Disc state: set a disconnected time limit so Windows cleans them up for you.
- The screen is black after you reconnect: press Ctrl + Alt + End and choose Cancel, or sign out and reconnect.
Next steps
- Clean up idle sessions automatically: Stop Remote Desktop sessions ending when idle or disconnected.
- Understand the session cap: The two-session RDP limit on Windows Server.
- When the error is about a signed-in user: Fix "another user is signed in" over RDP.
