Patching termsrv.dll on Windows Server 2022 is a technical workaround used primarily in development or lab environments to bypass the single RDP session limit. While it provides functionality similar to the licensed RDS Session Host, it requires maintenance after OS updates and carries significant risks regarding system stability and compliance.
Patching termsrv.dll on Windows Server 2022 to enable concurrent RDP sessions requires modifying system files. The most effective, automated approach is using specialized PowerShell patchers, such as TermsrvPatcher.
Disclaimer: Modifying termsrv.dll violates Microsoft EULA, may violate security policies, and could make your system unstable or unbootable. Always create a system restore point or backup before patching. This is typically for non-production lab environments. Recommended Approach: TermsrvPatcher (GitHub)
The TermsrvPatcher project by fabianosrc on GitHub provides a PowerShell script specifically designed to handle the required binary patching for Windows Server 2022 and other versions. Steps to Patch Download: Clone or download TermsrvPatcher.ps1 from GitHub.
Run as Administrator: Open PowerShell as Administrator and navigate to the folder containing the script. Execute: Run the script: powershell termsrv.dll patch windows server 2022
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass .\TermsrvPatcher.ps1 Use code with caution. Copied to clipboard
Restart: The script will automatically stop the Remote Desktop Service (TermService), create a backup, patch the file, and restart the service. Restart the server if necessary. Alternative Method: RDP Wrapper Library
RDP Wrapper (by stascorp) is another option, but it often struggles with Windows Server 2022 due to frequent build updates. If using this, you must keep the rdpwrap.ini file updated with the latest offsets. Patching Logic (Technical Breakdown)
If patching manually (e.g., using a hex editor like HxD), the general goal is to find the hex pattern 39 81 3C 06 00 00 (which compares the RDP session limit) and replace the surrounding bytes to allow multiple sessions. Commonly Updated Patch for 2022/2024 Server DLLs: Target Pattern: 39 81 3C 06 00 00 Replacement: B8 00 01 00 00 89 81 38 06 00 00 90 Patching termsrv
Note: With every Windows Update (e.g., KB5022842), the specific byte offsets change, making automated script patches (like fabianosrc/TermsrvPatcher) more reliable than manual editing. If you want, I can: Show you how to verify your exact termsrv.dll version
Provide a script to create a system restore point before you start Explain how to revert the patch if RDP stops working Let me know which step you'd like to dive into next. Windows server 2022 21H2 10.0.20348.1547 support missing
Here’s the proper technical text for patching termsrv.dll on Windows Server 2022 to enable multiple simultaneous RDP sessions (termsrv.dll patch / Concurrent RDP patch).
⚠️ Important:
This modifies a system file and violates Microsoft’s licensing terms for Windows Server (which normally limits to 2 admin sessions + 2 RDP for Remote Desktop Services in admin mode). Use only in lab/test environments, never in production without proper CALs. ⚠️ Important: This modifies a system file and
Initiate a third RDP session from a different client. Open Task Manager on the server → Users tab. You should see three active sessions.
To verify the limit change, run PowerShell:
Get-WmiObject -Class Win32_OperatingSystem | Select-Object *session*
After saving the modified file: