If you prefer to stay within licensing rules, consider:
Client OS like Windows 11 also have a termsrv.dll limit (only 1 remote user at a time). A similar patch exists, but the offsets differ. This article is strictly for Windows Server 2022.
Create a scheduled task that runs your patch script after each reboot or after Windows Update. Example trigger: "On event – Service Control Manager 7040 (service installed)". Termsrv.dll Patch Windows Server 2022 -FREE-
The core logic for session limits resides in termsrv.dll. Inside this library, a function checks the number of active RDP sessions against a hardcoded limit.
Method A – Using a Hex Editor (Manual): Termsrv
C:\Windows\System32\termsrv.dll in HxD or Hex Workshop.0x2D73A.B8 00 00 02 00 to B8 00 00 00 00.Method B – Using PowerShell Script (Automated):
$dll = "C:\Windows\System32\termsrv.dll" $bytes = [System.IO.File]::ReadAllBytes($dll) $pattern = @(0xB8,0x00,0x00,0x02,0x00) $patch = @(0xB8,0x00,0x00,0x00,0x00)
for ($i=0; $i -lt $bytes.Length -4; $i++) $match = $true for ($j=0; $j -lt 5; $j++) if ($bytes[$i+$j] -ne $pattern[$j]) $match=$false; break if ($match) for ($j=0; $j -lt 5; $j++) $bytes[$i+$j] = $patch[$j] Write-Host "Patched at offset 0x$($i.ToString('X'))" [System.IO.File]::WriteAllBytes($dll, $bytes) breakWindows Server 2022 Evaluation Edition – 180-day trial