Patch Windows Server 2022 — Termsrv.dll

takeown /f C:\Windows\System32\termsrv.dll
icacls C:\Windows\System32\termsrv.dll /grant administrators:F

Set up a scheduled task to check the number of allowed RDP sessions daily. Alert if it reverts to 2.

The RDP Wrapper Library by Stas'M supports Windows Server 2022 for RDP session limits, but it still circumvents licensing. It is technically a "wrapper," not a DLL patch, but legal risks remain identical.


Before touching the DLL, you must stop the Remote Desktop Services and backup the original file. termsrv.dll patch windows server 2022

For production environments: ABSOLUTELY NOT.
The risk of security breaches, update failures, audit findings, and legal liability dwarfs any short-term cost savings.

For home labs or isolated test environments:
Possible, if you accept the risks. Use snapshots, never expose the server to the internet, and treat the patched server as ephemeral. Many homelab enthusiasts successfully patch Windows Server 2022 but remain ready to redeploy from scratch. takeown /f C:\Windows\System32\termsrv

Key takeaway: The termsrv.dll patch is a hack, not a solution. The two-session limit is intentional—Microsoft’s licensing model for multi-user access has been clear for over two decades. If you need more than two RDP sessions, budget for RDS CALs or use alternative remote access tools.


  • Stability risks:
  • Legal/licensing risks:
  • Operational risk:
  • Windows Server 2022 checks the number of active RDP sessions via a function inside termsrv.dll. A specific conditional jump (branch instruction) determines whether a new session is allowed. By changing one byte from 0x75 (JNZ – jump if not zero) to 0x74 (JZ – jump if zero) or 0xEB (JMP – unconditional jump), the license check is disabled. Set up a scheduled task to check the

    For Server 2022, the patch typically modifies offset 0x2F288 (varies slightly by build) from 75 2E to 74 2E or EB 2E.