Patching the termsrv.dll file in Windows Server 2019 is a common method used to enable multiple concurrent Remote Desktop (RDP) sessions on a single machine. By default, Windows Server allows two administrative sessions; this patch removes that restriction. ⚠️ Important Considerations
Legal Compliance: This modification may violate Microsoft's Licensing Terms. In a production environment, the official way to support multiple users is via Remote Desktop Services (RDS) and Client Access Licenses (CALs).
System Stability: Modifying system files can cause instability or prevent Windows from booting if done incorrectly.
Windows Updates: Major updates often overwrite this file, requiring you to re-apply the patch. 🛠️ Prerequisites
Administrator Privileges: You must be logged in as an Admin.
Backup: Create a backup of the original C:\Windows\System32\termsrv.dll file.
Tools: You will need a Hex Editor (like HxD) or an automated patching script (like RDPWrap, though its compatibility with newer Server 2019 builds varies). 📖 Step-by-Step Manual Patching Guide 1. Stop the Remote Desktop Service You cannot modify the file while the service is running. Press Win + R, type services.msc, and hit Enter. Locate Remote Desktop Services. Right-click it and select Stop. 2. Take Ownership of the File Windows protects system files by default. Navigate to C:\Windows\System32\. windows server 2019 termsrvdll patch top
Find termsrv.dll. Right-click it → Properties → Security → Advanced. Change the Owner to your username or "Administrators". Close the properties and re-open them.
Under Security, give "Administrators" Full Control permissions. 3. Edit the DLL File (Hex Editing)
The goal is to find a specific byte sequence and change it to tell the system "always allow" instead of checking for a limit.
Note: The exact "Find" string changes based on your Windows build version. Open termsrv.dll in HxD.
Search for the following Hex sequence (common for Server 2019): Find: 39 81 3C 06 00 00 0F 84 XX XX XX XX Replace it with: Replace: B8 00 01 00 00 89 81 3C 06 00 00 90 Save the file. 4. Restart Services Go back to services.msc. Right-click Remote Desktop Services and select Start. 🔄 Alternative: RDP Wrapper Library
If you prefer not to edit Hex code manually, RDPWrap is a popular open-source "wrapper" that sits between the Service Control Manager and TermService. It does not modify the original termsrv.dll. It uses an .ini file to apply the patch in memory. Patching the termsrv
Note: Ensure you download the latest rdpwrap.ini from community-maintained GitHub repositories, as the original project is often outdated for newer Windows 10/Server 2019 builds. 🛡️ Troubleshooting
RDP Disconnecting: If users are kicked off, check if Group Policy is overriding your settings. Navigate to Computer Configuration > Administrative Templates > Windows Components > Remote Desktop Services > Remote Desktop Session Host > Connections and enable Limit number of connections.
Black Screen: This usually means the patch version didn't match your specific Windows Build Number. Restore your backup immediately.
g., 1809)? To help you further, I can also explain how to set up the official RDS role if this is for a business environment.
RDP Wrapper Library is the most famous third-party tool. It works by intercepting RDP calls rather than directly patching the DLL.
Steps:
RDPWrap-v1.6.2.zip from GitHub (or the developer’s site).install.bat as Administrator.RDPConf.exe to check status – all should show “green” (fully supported).termsrv.dll version is newer, update the rdpwrap.ini from the community repo.Pros: No permanent DLL modification; survives some updates; easy rollback.
Cons: Signature checks may fail after Windows Updates; requires manual INI updates.
termsrv.dll is the core system library responsible for managing Remote Desktop Protocol (RDP) sessions on Windows operating systems. In Windows client OS versions (Windows 10/11), the default limit is one active RDP session. In Windows Server (non-RDS role), the default limit is two administrative sessions.
Patching termsrv.dll modifies a specific byte or hex pattern within the DLL to bypass the session limit check, theoretically allowing an unlimited number of concurrent RDP connections.
Before applying any "top patch" for termsrv.dll, understand the consequences.
The original DLL checks for:
lsass.exe (Local Security Authority).HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\RCM\GracePeriod).fSingleSessionPerUser policy.Patching involves hex‑editing or binary patching specific offsets to: Method 1: Automatic Patcher Tool (RDP Wrapper Library)
| Function | Original Behavior | Patched Behavior |
|----------|------------------|------------------|
| LSUpdateLicenseStatus | Returns grace period remaining / enforcement | Forced “Licensed” status |
| IsGracePeriodRemaining | Counts down from 120 days | Always returns false (no grace period check) |
| TSLicenseCheck | Blocks new sessions if license invalid | NOP / always success |
| Session limit enforcement | Compares count to 2 | Bypasses limit check |
No permanent method exists because Microsoft changes the hex signature every few updates. Some tools auto-repatch, but this is unreliable.