termsrv.dll on Windows Server 2019 is a method used to bypass the default limit of two concurrent Remote Desktop Protocol (RDP) sessions without requiring the full installation of Remote Desktop Services (RDS) and associated Client Access Licenses (CALs). While often bundled in "repacks" or third-party scripts, this modification alters critical system binaries and carries significant risks. Purpose of the Patch Enable Concurrent Sessions
: By default, Windows Server permits only two administrative RDP sessions. Patching the termsrv.dll
file removes this enforcement code to allow multiple users to connect simultaneously without disrupting existing sessions. Avoid RDS Role Installation
: It is used as a workaround to gain multi-user capabilities without setting up a full RDS infrastructure, which typically requires paid licensing. How the Patch is Applied
The process generally involves identifying specific byte patterns within the DLL and replacing them with a custom patch. Common tools and methods include: Patching Microsoft's RDP service yourself - Sam Decrock
Enabling Multiple RDP Sessions on Windows Server 2019 Windows Server 2019 typically limits you to two concurrent Remote Desktop (RDP) sessions for administrative purposes. To bypass this and allow more users to connect at the same time, you can either adjust system policies or use tools like RDP Wrapper or manual termsrv.dll patches. Method 1: Using Group Policy (Built-in)
The most stable way to increase connections without third-party tools is through the Local Group Policy Editor.
Open Policy Editor: Press Win + R, type gpedit.msc, and hit Enter.
Navigate to Connections: Go to Computer Configuration > Administrative Templates > Windows Components > Remote Desktop Services > Remote Desktop Session Host > Connections. Termsrv.dll Patch Windows Server 2019 REPACK
Disable Session Restrictions: Double-click Restrict Remote Desktop Services user to a single Remote Desktop Services session and set it to Disabled.
Set Connection Limit: Double-click Limit number of connections, set it to Enabled, and enter your desired number (e.g., 999 for unlimited). Method 2: Manual Termsrv.dll Patching
For those who prefer a "repack" or manual approach, you can modify the termsrv.dll file found in C:\Windows\System32\. This method involves replacing specific hex code values that enforce session limits.
Common Search/Replace Pattern: For many versions of the x64 termsrv.dll (such as 10.0.19041.3155), the patch involves searching for hex string 39 81 3C 06 00 00 0F 84 87 46 01 00 and replacing it with B8 00 01 00 00 89 81 38 06 00 00 90.
Permissions: To replace this file, you must first take ownership of the DLL and grant yourself full control.
Backup First: Always create a backup (e.g., termsrv.dll.old) before attempting a manual swap. Method 3: Third-Party Automators
If manual hex editing is too complex, community-driven tools can automate the process:
RDP Wrapper Library: A popular tool that loads a wrapper between the Service Control Manager and Terminal Services without modifying the actual file. termsrv
TermsrvPatcher Scripts: Various PowerShell scripts can automate the process of stopping services, replacing the DLL, and restarting the system.
You cannot patch a file that is currently in use.
services.msc).(Alternatively, you can run net stop TermService in an elevated Command Prompt.)
Before understanding the patch, you must understand the target. Termsrv.dll (Terminal Services Library) is a core system file located in C:\Windows\System32. It is responsible for managing Remote Desktop Protocol (RDP) sessions, including:
Microsoft hardcodes the two-session limit within this DLL for non-RDS installations. The patch works by locating the specific hex byte patterns responsible for this check and altering them (e.g., changing a conditional jump instruction to a no-operation or an unconditional bypass).
If an organization still decides to proceed despite risks, follow strict controls (this is not an endorsement):
In the world of Windows Server administration, the file termsrv.dll is a critical system component responsible for managing Remote Desktop Services (RDP). Specifically, it enforces the licensing and concurrent user limits built into the operating system. By default, Windows Server 2019 allows only two concurrent administrative RDP sessions (plus the local console). For organizations needing more simultaneous remote connections without purchasing Remote Desktop Services Client Access Licenses (RDS CALs), an unofficial modification known as the “termsrv.dll patch” has circulated for years.
Recently, “REPACK” versions of this patch for Windows Server 2019 have appeared on various forums and file-sharing sites. This write-up explains what the patch does, why repacks exist, the severe risks involved, and legitimate alternatives. Step 3: Stop the Remote Desktop Service You
Install and configure Remote Desktop Services (RDS) properly
Use native Windows features for administration
Use virtualization or containerization
Third-party remote access tools
For non-production labs:
slmgr /rearm (not advised for production).The original Termsrv.dll patch has existed since the Windows 2000/XP days. However, Windows Server 2019 (build 1809 and later) introduced significant security mitigations:
Older patching tools (e.g., Universal Termsrv.dll Patch v2.x) often failed on Server 2019, leading to blue screens, boot loops, or simply being reverted by SFC.
The "REPACK" label indicates that a community group or cracker has: