What is it?
The termsrv.dll (Terminal Services DLL) is a critical system file in Windows Server 2016 that manages Remote Desktop Services (RDS). By default, Windows Server 2016 allows only two concurrent administrative remote desktop sessions (often called the "admin mode").
The so-called "termsrv.dll patch" is an unofficial modification to this file. Its purpose is to remove or increase the concurrent session limit, allowing multiple users to connect simultaneously via RDP without purchasing and installing Remote Desktop Session Host (RDSH) CALs (Client Access Licenses).
Why do people use it?
⚠️ Critical Warnings (Read Before Proceeding) termsrv.dll patch windows server 2016
You assume all liability if you proceed.
The termsrv.dll patch for Windows Server 2016 offers a tempting way to unlock unlimited concurrent RDP sessions without licensing costs. For homelabs, testing, and non-critical internal tools, it remains a popular workaround. However, production environments should never rely on this hack.
By following the step-by-step manual patching guide above—backing up files, using the correct hex pattern, and understanding the risks—you can safely remove the two-session limit. Just remember: every Windows Update may break the patch, and Microsoft’s licensing team will not forgive violations.
If you truly need multi-user RDP, budget for RDS CALs. But for the tinkerer and the budget-conscious lab admin, the termsrv.dll patch lives on as a clever, if unsanctioned, solution. Understanding the termsrv
This method gives you full control and works across all Server 2016 builds.
The termsrv.dll patch for Windows Server 2016 is a critical update that ensures the security, stability, and performance of Remote Desktop Services. Keeping these patches up to date is essential for administrators managing Windows Server environments, especially those with remote access configurations. Always follow best practices for applying updates, and be prepared to troubleshoot any issues that may arise.
termsrv.dll patches exist, but they also violate licensing.Open PowerShell as Administrator:
net stop TermService /y
There are two ways to apply the patch: manually using a Hex Editor or automatically using a PowerShell script. The PowerShell method is recommended for accuracy. Development/Test Environments: To allow a small team to
Method A: PowerShell Script (Recommended) This script automatically finds the correct byte pattern in the DLL and replaces it.
$path = "C:\Windows\System32\termsrv.dll"
# Define the byte patterns
# Pattern for Windows Server 2016 (Usually builds 14393)
$pattern = "39 81 3C 06 00 00 0F 84 7F 2C 01 00"
$replace = "B8 00 01 00 00 89 81 38 06 00 00 90"
# Read the file
$bytes = [System.IO.File]::ReadAllBytes($path)
# Convert pattern/replace to byte arrays
$patternBytes = $pattern.Split(' ') | ForEach-Object [Convert]::ToByte($_, 16)
$replaceBytes = $replace.Split(' ') | ForEach-Object [Convert]::ToByte($_, 16)
# Find and replace
$found = $false
for ($i = 0; $i -lt $bytes.Length - $patternBytes.Length; $i++)
$match = $true
for ($j = 0; $j -lt $patternBytes.Length; $j++)
if ($bytes[$i + $j] -ne $patternBytes[$j])
$match = $false
break
if ($match)
for ($k = 0; $k -lt $replaceBytes.Length; $k++)
$bytes[$i + $k] = $replaceBytes[$k]
$found = $true
Write-Host "Pattern found and patched at offset: $i"
break
if ($found)
[System.IO.File]::WriteAllBytes($path, $bytes)
Write-Host "termsrv.dll patched successfully."
else
Write-Host "Pattern not found. Your version might be different or already patched."
patch.ps1 and run it in PowerShell.Method B: Manual Hex Editor If the script fails, you can use a Hex Editor (like HxD).
termsrv.dll to your Desktop (editing it directly in System32 is often blocked).Ctrl+F and search for the Hex-values:
39 81 3C 06 00 00 0F 84 7F 2C 01 00B8 00 01 00 00 89 81 38 06 00 00 90C:\Windows\System32, overwriting the original.(Note: The byte pattern above applies to standard Windows Server 2016 builds. If your Windows Updates have updated termsrv.dll, the offsets may vary slightly. Common variations exist where 3C 06 might be 38 06.)
Before proceeding, understand the consequences:
termsrv.dll, reverting the patch. You must reapply after each update.SYSTEM_SERVICE_EXCEPTION) or RDP service failure.