I know this error is infuriating—you just want to remote into your server, and instead you get a wall of text about licensing. Let's get you connected.
The Fix That Works 90% of the Time
On the client machine (the one you're connecting from), you need to clear out the stored license. Windows caches a per-user license, and sometimes it gets corrupted or mismatched after updates. This trips up everyone eventually.
- Close all Remote Desktop sessions.
- Open the Registry Editor: press Win + R, type
regedit, hit Enter. - Navigate to this key:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSLicensing
- Right-click the MSLicensing key and select Delete. Yes, the whole thing.
- Confirm the deletion, then close Registry Editor.
- Try connecting again. The client will request a fresh license, and you should get in.
That's it. No reboot needed, no server-side changes. If this works, you're done.
Why This Works
Every time you connect to a terminal server, the client stores a license token locally so it doesn't have to renegotiate every session. That token lives under MSLicensing. If the token is stale—say, after a Windows update, a server-side licensing change, or a profile migration—the server rejects it because the client license isn't set properly. Deleting the key forces the client to drop the old token and request a new one on the next connection. It's the digital equivalent of clearing your throat before speaking again.
I've seen this exact error on Windows 10 and Windows 11 clients connecting to Windows Server 2016, 2019, and 2022. The trigger is almost always an update for me—one of my users ran into it right after a cumulative update rebooted their PC.
Less Common Variations
Server-Side Licensing Mode Is Off
If deleting the registry key doesn't fix it, check the server's licensing mode. This is less common because most admins set it once, but if someone changed it or the server is new, you'll see this error.
- On the server, open Server Manager.
- Go to Tools > Remote Desktop Services > Remote Desktop Session Host Configuration.
- Check the Licensing Mode—it should be Per User or Per Device, not Not Configured.
- If it's not configured, set it to match your environment. Then restart the session host service or reboot the server.
I've had this happen on a fresh server where someone skipped the licensing setup wizard. It's a five-minute fix that saves a whole afternoon of head-scratching.
Mismatch Between Client and Server
Another variation: the client has a license for a different terminal server. This usually happens when you connect to multiple servers from the same workstation and one of them has a different licensing setup. Deleting the registry key still works here, but you might need to do it more than once if you switch between servers frequently. In that case, consider setting up RD Connection Broker or standardizing your server licensing.
Corrupted User Profile on the Client
Rare, but if the registry fix works temporarily and then the error returns, your local user profile might be corrupted. The MSLicensing key is per-user, not per-machine. Try creating a new Windows user profile and connecting from there. If that works, you've found the culprit. Migrate your settings and move on.
Prevention
You won't avoid this error entirely—it's a Windows quirk that resurfaces after updates. But you can reduce the frequency:
- Keep Windows updated on both client and server. Microsoft has patched licensing bugs before, so staying current helps.
- Set the correct licensing mode on the server from day one. Don't leave it on "Not Configured" and hope for the best.
- Use a single terminal server per workstation when possible. Multiple servers with different licensing modes increase the chance of this error.
- Document your licensing—know whether you're on Per User or Per Device, and keep your licenses active. Expired licenses cause similar errors but with different codes.
If you're still stuck after trying these, check the server's event log for licensing-related entries. Sometimes the error code points to a deeper issue, like no licenses installed at all. But for most of you, that registry delete is the magic bullet. Go try it.