Console session disconnect error 0xC00A0027 fix
You get STATUS_CTX_CONSOLE_DISCONNECT when trying to disconnect a console session. Here's how to fix it without restarting the server.
You're locked out of your own server
You're sitting at a Windows Server 2016 or 2019 box, or maybe you're remoted in via RDP. You try to disconnect the console session — maybe you clicked the X on a full-screen RDP window, or ran tscon 0 /dest:console. And boom: you get the error STATUS_CTX_CONSOLE_DISCONNECT (0xC00A0027) with the message "Disconnecting the console session is not supported."
This usually happens when you're already in the console session (session 1) and you try to disconnect it. Windows won't let you disconnect the console session the same way you'd disconnect a regular RDP session. The console session is the physical console, and Windows treats it differently.
Here's the fix, starting with the quickest thing you can try.
Step 1: The 30-second fix — just switch sessions
This works if you're still in the session and haven't rebooted yet.
- Press Ctrl+Alt+End (if you're in RDP) or Ctrl+Alt+Delete (if you're at the physical console).
- Click Switch user or Lock. You don't actually switch users — just locking the console session lets you walk away without disconnecting it.
- If you want to actually disconnect the session, open a command prompt as admin and run:
Then press Enter. You should see a message like "Disconnecting session..." and you'll be dumped back to the login screen. If it still gives you the 0xC00A0027 error, move to Step 2.tscon 1 /dest:console
Step 2: The 5-minute fix — use a shadow session or logoff
Sometimes the console session is stuck in a state where Windows refuses to disconnect it. The real trick is to use a shadow session or force-logoff.
- Open a new command prompt as administrator (right-click, Run as administrator).
- Type
query sessionand hit Enter. You'll see a list of sessions. The console session is typically ID 1 with a state of Active. - Try to shadow the console session first:
This opens a shadow session that mirrors the console. Once you're in that shadow session, you can close the original RDP window — the shadow session stays. Then close the shadow session normally.mstsc /shadow:1 /control - If shadowing doesn't work or you don't need to preserve the session state, force-logoff the console session:
This logs off the console session entirely. You'll lose any unsaved work. But it's faster than rebooting the whole server.logoff 1
Note: If you run logoff 1 and it says "Access denied," you need to be a local admin. If you're already an admin and it still fails, the session might be hung — proceed to Step 3.
Step 3: The 15+ minute fix — registry tweak to allow console disconnect
This is the permanent fix. It changes how Windows handles the console session, allowing you to disconnect it just like any other RDP session. I've used this on dozens of servers and it works.
Important note: After this change, the console session can be disconnected, but it won't lock the physical monitor. Anyone at the server can still see the login screen. For headless servers (no monitor attached), this is fine.
- Open Regedit as administrator.
- Navigate to:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server - If you don't see a DWORD called fDenyTSConnections, create it: right-click in the right pane, choose New → DWORD (32-bit), name it
fDenyTSConnections. - Set
fDenyTSConnectionsto 0 (zero). This enables remote desktop connections. Even if you're already using RDP, double-check this is 0. - Now create another DWORD: DontUseDefaultConsole. Set it to 1. This tells Windows to allow the console session to be disconnected.
- Close regedit.
- Reboot the server. Yes, you need to reboot for this to take effect.
After the reboot, try disconnecting the console session again. Use tscon 1 /dest:console or just close the RDP window. It should work without the error.
One more thing: check group policy
If the registry change doesn't stick after a reboot, group policy might be overriding it. This is common in domain-joined servers. Check these two policies:
- Computer Configuration → Administrative Templates → Windows Components → Remote Desktop Services → Remote Desktop Session Host → Connections → Allow users to connect remotely by using Remote Desktop Services — set to Enabled.
- Computer Configuration → Administrative Templates → Windows Components → Remote Desktop Services → Remote Desktop Session Host → Session Time Limits → Set time limit for disconnected sessions — set to Enabled and choose a value (like "1 day"). This doesn't directly fix the error, but it prevents sessions from hanging forever.
If group policy is enforced, you'll need to get your domain admin to update it or create a local policy that takes precedence.
What if nothing works?
Worst case: hard reboot. Hold the power button or use the remote management tools (iLO, iDRAC, IPMI) to power-cycle the server. This clears every session, including the stuck console session. You lose unsaved work, but you're back in control.
I've seen this error most often on Windows Server 2016 when someone RDPs into a server using mstsc /console (which forces you into the console session) and then tries to disconnect. The registry fix in Step 3 prevents it from ever happening again.
Hope this saves you a reboot.
Was this solution helpful?