0X00001B81

ERROR_CTX_CONSOLE_DISCONNECT (0X00001B81) Fix

Network & Connectivity Intermediate 👁 0 views 📅 May 27, 2026

Disconnecting the console session isn't supported on Windows Server. The fix is a registry tweak or a Group Policy change. Here's why it happens and how to stop it.

This error is annoying, and there's a quick fix

You're trying to disconnect a Remote Desktop session — maybe you clicked "Disconnect" or ran a script — and you get ERROR_CTX_CONSOLE_DISCONNECT (0X00001B81). The message says disconnecting the console session isn't supported. The system isn't broken, but it's telling you something you need to know: you can't disconnect the physical console session like a regular RDP session. Here's how to fix it without pulling your hair out.

The real fix: three steps

  1. Open Registry Editor as Administrator. Hit Win+R, type regedit, right-click and run elevated.
  2. Navigate to
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server
  3. Create a new DWORD (32-bit) named fDisableConsoleSessionDisconnect. Set its value to 0 (that's the default, but we're making it explicit).

That's it. Reboot the server or restart the TermService service in Services.msc. The error should vanish.

If you prefer Group Policy: go to Computer Configuration > Administrative Templates > Windows Components > Remote Desktop Services > Remote Desktop Session Host > Connections. Find "Disconnect sessions from console" and set it to Enabled. That's the same thing, just via policy.

Why this works

Here's what's actually happening. Windows Server has two session types: console sessions (the physical display, keyboard, and mouse) and remote sessions (RDP). The console session is special — it's the one running the graphical shell on the actual monitor. You can't disconnect it because there's no other session to take its place. The system treats it as the last resort for admin access. The error code 0X00001B81 maps to ERROR_CTX_CONSOLE_DISCONNECT in winerror.h, and it's been there since Windows Server 2003.

The registry key fDisableConsoleSessionDisconnect tells the Terminal Server service whether to allow disconnecting the console session. Setting it to 0 (false) actually enables the ability to disconnect. Yes, the naming is backwards — it's a double negative. Microsoft's logic is: by default, the feature to disable disconnects is off, so disconnects are blocked. You're flipping that to allow it. The Group Policy setting matches the name more intuitively.

But here's the catch: even after this fix, disconnecting the console session doesn't free up resources like a logoff. The session stays in memory, holding onto user profile, registry hives, and processes. If you're disconnecting to save memory or avoid a lockout, you're better off logging off.

Less common variations of this issue

Sometimes the error pops up in unexpected places:

  • Hyper-V console: If you're connected to a VM via Hyper-V Manager and try to disconnect, you can get this error. The fix is the same registry key on the host machine, not the VM. Hyper-V's enhanced session mode can trigger this.
  • Shadow sessions: When an admin shadows (remotely views) another user's console session and tries to disconnect, this error can occur. The fix works here too.
  • Third-party RDP clients: Some clients (like mRemoteNG or Royal TS) send a disconnect command that gets misinterpreted as a console disconnect. If the registry fix doesn't help, check the client's session type setting — force it to remote session, not console.
  • Windows 10/11: Rare on desktop OS, but if you've enabled RDP, you might see it on a system with only one user session. The registry key exists there too, but it's less likely to help because desktop Windows doesn't officially support console disconnect in most builds.

Prevention

Stop trying to disconnect the console session. Seriously. If you're building scripts or automation, don't call Disconnect() on session 0 or 1 (the console). Instead, log off the user with logoff from the command line, or use tsdiscon with the right session ID — tsdiscon 1 will disconnect session 1, but again, that's the console and you'll get the error unless you apply the fix.

If you really need to disconnect the console (like for a headless server where you want to free up a license), apply the registry fix before you hit the problem. Test it on a non-production server first. And remember: disconnecting leaves the session running. It's not a clean logout. User profiles stay loaded, which can cause issues with profile corruption, especially in environments with roaming profiles or folder redirection.

My opinion: don't disconnect unless you have a specific reason. Log off properly. It's cleaner, safer, and avoids this error entirely. The registry fix is a workaround, not a best practice.

Was this solution helpful?