Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RDPWrap Self-Heal

Self-healing RDP Wrapper for multi-session Remote Desktop on Windows 10, 11 & Server

Automatically repair RDP Wrapper after Windows Update — regenerate termsrv.dll / rdpwrap.ini offsets, fix Windows Server MaxSessions, and restore concurrent Remote Desktop sessions on boot.


RDPWrap Self-Heal — self-healing multi-session Remote Desktop for Windows


License Platform PowerShell Arch Status GitHub stars GitHub issues Last commit


git clone https://github.com/BuildWithSubha/RDPWrap-Self-Heal.git
# Right-click Install.bat → Run as administrator

Why it breaks · Features · Quick Start · Usage · Troubleshooting · FAQ · Contributing


Table of Contents


What is RDPWrap Self-Heal?

RDPWrap Self-Heal is an open-source installer and automation package for RDP Wrapper on Windows 10, Windows 11, and Windows Server (2019 / 2022 / 2025). It keeps multiple concurrent Remote Desktop (RDP) sessions working when Microsoft updates replace termsrv.dll and invalidate rdpwrap.ini offsets.

In plain terms: if RDP Wrapper stops after a Windows Update — RDPConf shows [not supported], or worse [fully supported] while the third user still disconnects — this project installs the wrapper, regenerates offsets with OffsetFinder, enforces Server MaxSessions=0, and registers boot + daily repair tasks so multi-session RDP can recover automatically.

Capability What you get
Multi-session RDP Concurrent Active sessions for multiple users
Post-update repair Auto-heal after termsrv.dll changes
Windows Server fix Removes the common Remote Admin 2-session cap
Homelab / lab friendly No RDS CALs path (unsupported by Microsoft — see legal)

Verified on Windows Server 2025 with three concurrent Active RDP sessions after a termsrv update broke a long-running install.


Why RDP Wrapper breaks after Windows Update

RDP Wrapper enables concurrent Remote Desktop sessions by patching policy checks inside Windows Terminal Services (termsrv.dll). Every Windows Update that replaces termsrv.dll can change memory offsets. Without updated rdpwrap.ini sections, multi-session RDP fails — often in confusing ways:

Symptom people search for What you see
“RDP Wrapper not supported” RDPConf / RDP_CnC shows [not supported]
“RDPConf fully supported but third user disconnects” Green status, then a 30-second disconnect prompt for the 3rd session
“Windows Server only allows 2 RDP sessions” Cap remains even when offsets look correct (MaxSessions=2)

Important

Green RDPConf is not proof of working multi-session RDP.
Run query user and confirm 3+ Active sessions — that is the real test.

Diagram comparing misleading green RDPConf status with real proof from query user showing three Active sessions


Who this is for

  • Homelab and small-team admins who need multiple RDP sessions on Windows 10/11
  • Operators running Windows Server without (or instead of) full RDS Session Host + RDS CALs
  • Anyone whose RDP Wrapper broke after Windows Update and needs a repeatable repair path
  • Maintainers who want OffsetFinder + community rdpwrap.ini + scheduled self-heal in one package

If you need Microsoft-supported multi-user Remote Desktop, use the official Remote Desktop Session Host role and RDS licensing instead.


Features

Feature overview: automatic repair, correct offsets, Server MaxSessions fix, and status diagnostics

Automation & self-heal

  • One-click elevated install (Install.bat)
  • Modes: Install · Repair · Status · Uninstall
  • Smart repair — skips work when already healthy
  • Boot + daily SYSTEM scheduled tasks after Windows Update

Correct offsets & Server policy

  • Matches termsrv.dll by FileVersionRaw (not the lagging FileVersion string)
  • Forces SLPolicy MaxSessions=0 for Windows Server multi-session RDP
  • Dual sources: OffsetFinder → community rdpwrap.ini
  • Timestamped rdpwrap.ini backups before every merge

Operations & diagnostics

  • Enables RDP and disables single-session-per-user in the registry
  • Structured logs under Program Files\RDP Wrapper\logs\
  • Status mode for version, hook, listener, and query user
  • Task uninstall without removing the RDP Wrapper hook

Resilience

  • Offline repair when PDB / symbols are available
  • Online fallback when OffsetFinder cannot produce offsets
  • Survives Windows Update + reboot cycles
  • Clear errors when a new termsrv build has no offsets yet

Scheduled self-heal tasks

Task When Runs as Purpose
RDPWrap-SelfHeal-Boot ~2 minutes after startup SYSTEM (Highest) Repair after update reboot
RDPWrap-SelfHeal-Daily Every day at 03:00 SYSTEM (Highest) Catch missed repairs

Both run -Mode Repair from C:\Program Files\RDP Wrapper\.


Quick Start: Install multi-session RDP

1. Download the package

git clone https://github.com/BuildWithSubha/RDPWrap-Self-Heal.git
cd RDPWrap-Self-Heal

Or download the repository ZIP from GitHub and extract it.

2. Install RDP Wrapper Self-Heal

Recommended — one click

Right-click Install.batRun as administrator

Or elevated PowerShell

Set-ExecutionPolicy -Scope Process Bypass
.\scripts\Install-RDPWrapSelfHeal.ps1 -Mode Install

3. Check RDP_CnC / RDPConf

Open C:\Program Files\RDP Wrapper\RDP_CnC.exe and confirm:

  • Wrapper Installed
  • Service Running
  • Listener Listening
  • Single session per user unchecked
  • [fully supported] (ideal — not required for proof)

4. Prove concurrent RDP sessions work

Keep one session open, connect two more users, then run:

query user

Success example (3 Active RDP sessions):

 USERNAME              SESSIONNAME        ID  STATE   IDLE TIME  LOGON TIME
 Administrator         rdp-tcp#0           1  Active          .  7/23/2026 9:00 AM
 test                  rdp-tcp#1           2  Active          .  7/23/2026 9:05 AM
 ankit                 rdp-tcp#2           3  Active          .  7/23/2026 9:06 AM

Three or more Active lines means multi-session Remote Desktop is working.


System requirements

Requirement Details
Operating system Windows 10, Windows 11, or Windows Server 2019 / 2022 / 2025
Architecture x64 only
Privileges Administrator for install and repair
PowerShell 5.1 or later
Network Optional — required only for community rdpwrap.ini fallback
Symbols / PDB Optional — enables offline OffsetFinder against termsrv.dll

Warning

Do not install alongside RDS-RD-Server (Remote Desktop Session Host).
Choose either RDP Wrapper or official RDS — not both.


Installation guide

What -Mode Install does

  1. Validates Administrator rights and package files
  2. Deploys bin\ + OffsetFinder → C:\Program Files\RDP Wrapper\
  3. Copies the self-heal script for scheduled tasks
  4. Enforces MaxSessions=0 in rdpwrap.ini (critical on Windows Server)
  5. Registers boot + daily repair tasks
  6. Runs an initial repair: hook TermService, apply offsets, update registry, restart the service

Installed files

C:\Program Files\RDP Wrapper\
├── rdpwrap.dll                 # RDP Wrapper library
├── rdpwrap.ini                 # Offset database + SLPolicy
├── RDPWInst.exe                # Wrapper installer / uninstaller
├── RDP_CnC.exe                 # RDP control panel (RDPConf-style)
├── RDPWrapOffsetFinder.exe     # Offset generator
├── Install-RDPWrapSelfHeal.ps1 # Self-heal orchestrator
└── logs\
    └── selfheal_YYYYMMDD.log

Antivirus note (rdpwrap.dll quarantined)

Caution

Security tools often quarantine rdpwrap.dll as potentially unwanted software.
Add an exclusion for C:\Program Files\RDP Wrapper\ and this repository folder.
If the DLL is removed, restore bin/rdpwrap.dll and re-run Install.

Uninstall

# Remove self-heal tasks only (keep RDP Wrapper)
.\scripts\Install-RDPWrapSelfHeal.ps1 -Mode Uninstall

# Fully remove the RDP Wrapper hook from TermService
& "$env:ProgramFiles\RDP Wrapper\RDPWInst.exe" -u

Usage and commands

Modes

Mode Command When to use
Install -Mode Install First-time setup of multi-session RDP Wrapper
Repair -Mode Repair After Windows Update if auto-heal did not finish
Force repair -Mode Repair -Force Always regenerate termsrv offsets
Status -Mode Status Diagnose wrapper, MaxSessions, listener, sessions
Uninstall -Mode Uninstall Remove self-heal tasks only

Examples

# Fresh install of RDP Wrapper Self-Heal
.\scripts\Install-RDPWrapSelfHeal.ps1 -Mode Install

# Repair RDP Wrapper after Windows Update
.\scripts\Install-RDPWrapSelfHeal.ps1 -Mode Repair -Force

# Check multi-session RDP health
.\scripts\Install-RDPWrapSelfHeal.ps1 -Mode Status

# Same entry point the scheduled tasks use
& "$env:ProgramFiles\RDP Wrapper\Install-RDPWrapSelfHeal.ps1" -Mode Repair

Web Status & Management Dashboard (Zero Install)

You can launch the web-based monitoring dashboard to inspect health metrics, active RDP sessions, and logs in your browser:

  1. Right-click dashboard\Launch-Dashboard.batRun as administrator.
  2. Open http://localhost:8888 in any browser.

Features:

  • 🟢 Live Health Indicator: termsrv.dll offset match, listener, and service hook status.
  • 👥 Active RDP Session Manager: View connected user accounts and disconnect/logoff sessions with 1-click.
  • 1-Click Self-Heal Repair: Trigger dynamic offset repair directly from the UI.
  • 📜 Log Terminal Viewer: Embedded live logs view (selfheal_YYYYMMDD.log).

Logs

Get-Content "$env:ProgramFiles\RDP Wrapper\logs\selfheal_$(Get-Date -Format yyyyMMdd).log" -Tail 50

Architecture

Architecture overview from Install.bat through OffsetFinder and rdpwrap.ini to TermService with boot and daily self-heal tasks

Layer Component Role
Entry Install.bat Elevation check → PowerShell
Orchestration scripts/Install-RDPWrapSelfHeal.ps1 Modes, logging, error handling
Runtime bin/ rdpwrap.dll, installer, ini, RDP_CnC
Offsets tools/OffsetFinder/ PDB / pattern offset generation for termsrv.dll
Persistence Scheduled Tasks Automatic repair after Windows Update

Repair decision tree

flowchart TD
    A[Start Repair] --> B[Read FileVersionRaw]
    B --> C{ini has version section?}
    C -->|No| G[Generate offsets]
    C -->|Yes| D{rdpwrap.dll loaded?}
    D -->|No| G
    D -->|Yes| E{Port 3389 listening?}
    E -->|No| G
    E -->|Yes| F{-Force?}
    F -->|Yes| G
    F -->|No| H[Skip regen — enforce MaxSessions + registry]
    G --> I[OffsetFinder]
    I -->|fail| J[Community ini]
    J -->|fail| K[Error]
    I -->|ok| L[Merge ini + MaxSessions=0]
    J -->|ok| L
    L --> M[Restart TermService]
    M --> N[Verify hook + listener]
    H --> N
Loading

How self-heal works

Five-step self-heal flow: Windows Update, reboot, boot task, regenerate offsets, multi-session RDP restored

sequenceDiagram
    participant WU as Windows Update
    participant OS as Windows
    participant Task as Self-Heal Task
    participant Script as PowerShell Script
    participant Finder as OffsetFinder
    participant Ini as rdpwrap.ini
    participant TS as TermService

    WU->>OS: Replace termsrv.dll
    OS->>OS: Reboot
    Note over Task: ~2 minutes after startup
    Task->>Script: -Mode Repair
    Script->>OS: Read FileVersionRaw
    Script->>Ini: Check for version section

    alt Missing section or -Force
        Script->>Finder: Analyze termsrv.dll
        Finder-->>Script: version + version-SLInit
        Script->>Ini: Merge sections, MaxSessions=0
        Script->>TS: Restart
    else Already healthy
        Script->>Ini: Enforce MaxSessions only
    end

    Script->>Script: Verify wrapper loaded + :3389 listening
Loading

How offsets are resolved

  1. OffsetFinder — analyze local termsrv.dll (PDB/symbols when available)
  2. Community ini — fetch matching sections from sebaxakerhtc/rdpwrap.ini
  3. Fail clearly — report the termsrv version that still needs offsets

Jump to: Quick Start · Troubleshooting · FAQ


Repository layout

RDPWrap-SelfHeal/
├── Install.bat                       # One-click elevated installer
├── README.md                         # Documentation (this file)
├── LICENSE                           # Apache-2.0
├── NOTICE                            # Third-party notices
├── CREDITS.md
├── .gitignore
│
├── bin/                              # RDP Wrapper runtime
│   ├── rdpwrap.dll
│   ├── rdpwrap.ini                   # Community offsets + MaxSessions=0
│   ├── RDPWInst.exe
│   ├── RDP_CnC.exe
│   └── update.bat
│
├── scripts/
│   └── Install-RDPWrapSelfHeal.ps1   # Install / Repair / Status / Uninstall
│
├── tools/OffsetFinder/
│   ├── 64bit/                        # Deployed finder (+ optional PDBs)
│   └── 32bit/                        # Bundled; not used by the x64 installer
│
└── docs/
    ├── TROUBLESHOOTING.md            # Extended RDP Wrapper troubleshooting
    ├── PUBLISH.md                    # Maintainer publish + discoverability checklist
    └── images/                       # README diagrams (PNG for GitHub; SVG sources kept)
        ├── hero-banner.jpg
        ├── features-overview.png
        ├── proof-vs-rdpconf.png
        ├── architecture.png
        └── selfheal-flow.png

Technical notes

FileVersionRaw vs FileVersion (common RDP Wrapper footgun)

Windows Explorer may show 10.0.26100.32684 while the PE private build is 10.0.26100.33158. RDP Wrapper matches the raw four-part version in rdpwrap.ini. This project always uses raw:

$vi = (Get-Item $env:SystemRoot\System32\termsrv.dll).VersionInfo
'{0}.{1}.{2}.{3}' -f $vi.FileMajorPart, $vi.FileMinorPart, $vi.FileBuildPart, $vi.FilePrivatePart

Why MaxSessions=0 matters for Windows Server RDP

Stock community rdpwrap.ini often ships:

TerminalServices-RemoteConnectionManager-45344fe7-00e6-4ac6-9f01-d01fd4ffadfb-MaxSessions=2

That re-applies Remote Administration’s two-session policy. This package sets it to 0 (unlimited). Without that change, Server hosts often stay capped at 2 RDP sessions even when DefPolicy offsets are correct and RDPConf is green.

RDP Wrapper vs Remote Desktop Session Host (RDS)

Approach Pros Cons
RDP Wrapper (this repository) Familiar for labs; no RDS CAL workflow Unsupported by Microsoft; can break on new termsrv builds
RDS-RD-Server Official multi-user Remote Desktop Grace period, then RDS CALs + license server

FAQ

How do I enable multiple RDP sessions on Windows 10 or Windows 11?

Install this package with Install.bat (Run as administrator), then verify with query user while three users are connected. Consumer Windows editions are not licensed for unlimited concurrent RDP the way Server/RDS is — comply with Microsoft licensing for your scenario.

Why does RDP Wrapper stop working after Windows Update?

Windows Update often replaces termsrv.dll. Offset entries in rdpwrap.ini no longer match, so the wrapper cannot patch Terminal Services correctly. This project’s boot task regenerates offsets after reboot.

RDPConf says fully supported but the 3rd user still disconnects — why?

RDPConf mainly checks whether offsets exist and the wrapper is loaded. Session policy (especially Server MaxSessions=2) can still block concurrent users. Run -Mode Repair -Force, confirm MaxSessions=0, and verify with query user.

How do I fix RDP Wrapper showing [not supported]?
.\scripts\Install-RDPWrapSelfHeal.ps1 -Mode Repair -Force

If OffsetFinder and the community ini both lack your termsrv build, wait for updated offsets or generate them with symbols, then repair again. See Troubleshooting.

Is RDP Wrapper supported by Microsoft?

No. It modifies Terminal Services behavior and is unsupported. Use at your own risk and ensure licensing compliance. Official multi-user RDP uses Remote Desktop Session Host + RDS CALs.

Do I need internet for OffsetFinder?

Not if local PDB/symbols can produce offsets. Internet is required for the community rdpwrap.ini fallback when the finder fails.

Can I use this with RD Session Host / RDS-RD-Server installed?

No. Do not mix RDP Wrapper with RDS-RD-Server. Uninstall one before using the other. “No Remote Desktop Licence Servers available” is an RDS message, not an RDP Wrapper message.

Does this work on Windows Server 2022 and 2025?

Yes — that is a primary target. Server builds often need the MaxSessions=0 fix in addition to correct offsets. Always prove with query user, not RDPConf alone.


Troubleshooting common RDP Wrapper errors

Problem / search phrase Fix
Third RDP user kicked after 30 seconds .\scripts\Install-RDPWrapSelfHeal.ps1 -Mode Repair -Force
RDP Wrapper / RDPConf [not supported] Force repair; check logs if OffsetFinder failed
RDP broken after Windows Update Wait for reboot + ~2 min boot task, then force repair
Antivirus deleted rdpwrap.dll Restore from bin\, add exclusion, re-run Install
Only 2 RDP sessions on Windows Server Confirm MaxSessions=0 in rdpwrap.ini, then repair
“No Remote Desktop Licence Servers available” RDS Session Host is installed — remove RDS or configure licensing

Diagnostic commands

.\scripts\Install-RDPWrapSelfHeal.ps1 -Mode Status

Select-String -Path "$env:ProgramFiles\RDP Wrapper\rdpwrap.ini" -Pattern '45344fe7.*MaxSessions'
tasklist /m rdpwrap.dll
query user

Before opening a GitHub issue

Include:

  1. Output of -Mode Status
  2. query user while reproducing
  3. termsrv.dll FileVersionRaw (not Explorer’s string)
  4. Client vs Server SKU
  5. Whether RDS Session Host is installed:
Get-WindowsFeature RDS-RD-Server

Extended guide: docs/TROUBLESHOOTING.md


Roadmap

Version Focus Status
v1.0 Install / Repair / Status / Uninstall, FileVersionRaw matching, OffsetFinder + community fallback, MaxSessions=0, boot/daily tasks, docs ✅ Shipped
v1.1 CI syntax checks, release ZIPs, -WhatIf dry-run, Windows Event Log entries 🔲 Planned
v1.2 -Mode Diagnose JSON export, post-repair notifications, offset contribution helper 🔲 Planned
Later Winget package, VM-based integration tests 💭 Ideas

Track progress in GitHub Issues.


Contributing

Contributions help more people find and fix broken multi-session RDP installs — especially new termsrv.dll offsets, clearer diagnostics, and documentation improvements.

Workflow

  1. Fork BuildWithSubha/RDPWrap-Self-Heal
  2. Create a branch: feature/… or fix/…
  3. Keep the change focused (one concern per PR)
  4. Test on a Windows VM: Install → connect 3 users → query user
  5. Open a pull request with what changed and how you verified it

Local development

git clone https://github.com/BuildWithSubha/RDPWrap-Self-Heal.git
cd RDPWrap-Self-Heal

# Syntax check
powershell -NoProfile -Command "& { $null = [System.Management.Automation.Language.Parser]::ParseFile('scripts\Install-RDPWrapSelfHeal.ps1', [ref]$null, [ref]$errs); if ($errs) { $errs; exit 1 } else { 'OK' } }"

# Read-only health check (if already installed)
.\scripts\Install-RDPWrapSelfHeal.ps1 -Mode Status

Offset contributions

If you confirm a new Windows build:

  1. Prefer OffsetFinder-generated [version] + [version-SLInit] blocks
  2. Contribute upstream to sebaxakerhtc/rdpwrap.ini
  3. Optionally open a PR here to refresh the bundled ini

Guidelines

  • Do not commit secrets, credentials, or machine-specific dumps
  • Do not submit pirated RDS CALs or licensing circumvention tools
  • Match existing PowerShell style; keep diffs small
  • Prefer evidence (query user, FileVersionRaw, Status output) over screenshots alone

Security and legal

Warning

Use at your own risk. RDP Wrapper modifies Terminal Services. Antivirus may flag rdpwrap.dll.

  • Enabling concurrent Remote Desktop sessions on editions that do not include that right may violate Microsoft licensing. Compliance is your responsibility.
  • Upstream binaries are redistributed for convenience; copyright remains with original authors — see NOTICE and CREDITS.md.
  • Cached Microsoft symbols under tools/OffsetFinder/*/sym/ follow Microsoft symbol license terms. Remove sym/ before publishing if unsure.

License

Licensed under the Apache License 2.0.

Third-party components keep their own licenses — see NOTICE.


Credits and related projects

This repository is a packaging and self-heal automation layer built on community work:

Project Role
stascorp/rdpwrap Original RDP Wrapper Library
sebaxakerhtc/rdpwrap Modern installer / RDP_CnC
sebaxakerhtc/rdpwrap.ini Community rdpwrap.ini offset database
llccd/RDPWrapOffsetFinder Offset generation for new termsrv.dll builds

Full attributions: CREDITS.md · Maintainer checklist: docs/PUBLISH.md


Looking for a self-healing RDP Wrapper that survives Windows Update?
If this restored your concurrent Remote Desktop sessions, consider starring the repo.


Star


Report an Issue · Request a Feature · Troubleshooting · Contributing · License

About

Self-healing RDP Wrapper for Windows 10/11/Server — auto-repairs multi-session Remote Desktop after Windows Update by regenerating termsrv.dll offsets and fixing MaxSessions.

Topics

Resources

Stars

82 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages