Windows desktop MVP for a high-DPI friendly RDP central management tool.
First version:
- Client UI: WPF on .NET 8/10, with a clean desktop management-console layout.
- RDP engine: Microsoft RDP ActiveX hosted inside WPF through
WindowsFormsHost. - Local data: SQLite.
- Credentials: Windows DPAPI and Windows Credential Manager.
- Proxy routing: local TCP forwarder for SOCKS5 and SSH tunnel profiles.
- Monitoring: ICMP ping, TCP 3389 probe, lightweight RDP handshake probe.
- Logging: local structured logs, later upgraded to central audit logs.
Why this stack:
- Microsoft RDP ActiveX avoids rebuilding the RDP protocol, NLA, CredSSP, clipboard, audio, printer, disk redirection, and certificate behavior.
- WPF is stable for Windows operations tooling and can host the RDP control.
- DPAPI and Credential Manager fit the Windows security model better than a custom password store for the first release.
- SQLite is enough for the single-machine MVP and can later sync to a central PostgreSQL/MySQL service.
Later versions can add WinUI 3 styling or a Web admin backend, but the RDP session client should remain native Windows until cross-platform support becomes a hard requirement.
This repository is intentionally shaped around the product direction from the attached specification:
- centralized server grouping, tags, search, and detail panels
- per-server DPI strategy profiles, with separate handling for Windows Server 2008 R2 and modern Windows Server versions
- per-server route profiles for direct, SOCKS5, SSH tunnel, RD Gateway, and jump host style connection paths
- monitor snapshots for ping, RDP port, handshake, alert, and probe status
- an adapter boundary for hosting Microsoft RDP ActiveX rather than reimplementing the RDP protocol
The current project is a WPF prototype:
RdpManager/Modelscontains the domain model for groups, servers, DPI, proxies, monitoring, and generated RDP settings.RdpManager/Services/DpiRecommendationService.csgenerates host-specific DPI recommendations and.rdpstyle properties.RdpManager/Services/ProxyRouteService.csdecides whether a connection should use the real target or a local forwarding endpoint such as127.0.0.1:<port>.RdpManager/Services/ConnectionProfileBuilder.cscomposes the DPI and route layers into the profile that will be passed to the RDP control.RdpManager/Adapters/RdpSessionAdapter.cswrites a generated.rdpfile and opens an embedded RDP ActiveX session window, falling back tomstsc.exeif the embedded control cannot be created.RdpManager/Views/RdpSessionWindow.xamlhosts the Microsoft RDP ActiveX control inside WPF throughWindowsFormsHost.RdpManager/Views/RdpSessionView.xamlhosts an RDP session inside a main window tab and provides session controls for disconnect, reconnect, DPI refresh, fullscreen, copy host, and copy username. It also polls the ActiveX connection state and automatically falls back tomstsc.exewhen embedded startup fails.RdpManager/Adapters/ActiveX/MsRdpClientHost.csmaps generated connection settings onto the RDP ActiveX control.RdpManager/Adapters/Forwarding/Socks5Forwarder.csstarts a local no-auth SOCKS5 TCP forwarder for per-server SOCKS5 routes.RdpManager/Views/ServerEditorWindow.xamlprovides the add-server dialog.RdpManager/Services/ServerRepository.cspersists the server list to local JSON under%LOCALAPPDATA%\RdpCommandCenter\servers.json.RdpManager/Services/CredentialVaultService.csencrypts saved passwords with Windows DPAPI for the current Windows user.RdpManager/Services/CertificatePolicyService.csblocks proxied routes unless a pinned RDP certificate thumbprint has been recorded for the server.RdpManager/Services/RdpCertificateProbeService.csperforms an RDP negotiation preflight and reads the remote TLS certificate thumbprint withSslStream.RdpManager/Services/ConnectionLogRepository.csstores recent connection audit entries under%LOCALAPPDATA%\RdpCommandCenter\connection-log.json.RdpManager/Services/AlertRepository.csstores alert records under%LOCALAPPDATA%\RdpCommandCenter\alerts.json.RdpManager/Views/AlertCenterWindow.xamlprovides alert filtering, acknowledgement, silencing, and manual resolution.RdpManager/Services/BackupService.csexports and restores a JSON backup package containing servers, connection logs, alerts, and audit logs.RdpManager/Views/BackupPreviewWindow.xamlvalidates and previews a backup before restore.RdpManager/Services/AppSettingsRepository.csstores user settings under%LOCALAPPDATA%\RdpCommandCenter\settings.json.RdpManager/Views/SettingsWindow.xamlprovides the settings center.RdpManager/Views/ErrorDialogWindow.xamlprovides a unified error dialog with copyable diagnostic details for import, export, backup, restore, and settings failures.RdpManager/Services/AppLogService.cswrites startup and unhandled exception diagnostics to%LOCALAPPDATA%\RdpCommandCenter\app.log.RdpManager/Services/AuditLogRepository.csstores operator audit events in the SQLite database.- Repositories implement
IDataRepository<T>, with JSON and SQLite collection repository implementations available. RdpManager/Services/SqliteCollectionRepository.csstores servers, connection logs, alerts, and audit logs in%LOCALAPPDATA%\RdpCommandCenter\rdp-command-center.db, with automatic migration from the older JSON files when SQLite is empty.- SQLite tables keep the JSON payload for compatibility and also maintain normalized searchable columns and indexes for servers, connection logs, alerts, and audit logs.
RdpManager.Cliprovides maintenance commands such as writing DPAPI-encrypted credentials without launching the WPF UI.RdpManager/Services/MonitorProbeService.csperforms live Ping and TCP RDP port checks for the selected server.- Monitoring supports queued concurrent probes, configurable concurrency, cancellation, and progress text for batch/background runs.
RdpManager/Services/ServerImportService.csimports server records from CSV,.rdp, and mRemoteNG XML files.RdpManager/Views/ImportPreviewWindow.xamlshows an import preview before changes are applied, including add/update/skip status and changed fields.- The import preview lets operators choose which field groups to overwrite: profile, credentials, route, DPI, and certificate.
.rdpfolder import recursively scans a selected folder and sends the result through the same preview workflow.- Imports are merged by
host:port: new endpoints are added, existing endpoints are updated in place, and saved encrypted passwords are preserved unless the imported record explicitly carries an encrypted password. RdpManager/Services/ServerExportService.csexports the currently filtered server list to CSV without plaintext passwords.RdpManager/Views/BatchSettingsWindow.xamlapplies DPI preference and proxy route changes to the currently filtered server list.- Batch settings can also update username, domain, group path, and tags for the currently filtered server list when those fields are provided.
RdpManager/Services/SearchFilterService.cssupports advanced search tokens such astag:production os:2008 status:offline proxy:socks5.RdpManager/ViewModels/MainWindowViewModel.csprovides sample groups and servers so the UI can be exercised before storage and live probes exist.
CSV import recognizes these headers when present:
name,host,port,group,os,tags,owner,proxyMode,proxyHost,proxyPort,description
Web-01,192.168.1.10,3389,Client A/Production,Windows Server 2019,"web,production",Ops,direct,,,
Legacy-01,10.20.8.12,3389,Client A/Production,Windows Server 2008 R2,"2008R2,finance",Alice,socks5,127.0.0.1,1080,Legacy finance servermRemoteNG XML import:
- Recursively imports
Nodeentries withProtocol="RDP". - Preserves mRemoteNG container paths as groups.
- Imports host, port, username, domain, and description.
- Encrypted mRemoteNG passwords are not imported.
Import conflict handling:
- Existing servers are matched by host and port.
- Matching records are updated instead of duplicated.
- Name, group, OS hint, owner, description, tags, DPI, proxy, username, domain, and pinned certificate data can be refreshed from the import.
- Existing DPAPI-encrypted saved passwords are kept unless an imported record contains an encrypted password value.
- The preview grid lets an operator uncheck individual records before applying the import.
- Folder import can recursively load
.rdpfiles and then applies the same conflict rules.
Credential handling:
- Usernames and domains can be stored per server.
- Passwords are optional.
- Saved passwords are encrypted with Windows DPAPI for the current user.
- Generated
.rdpfiles include the username only, never the password. - CSV import does not import plaintext passwords.
Certificate handling:
- Each server can store a pinned RDP certificate thumbprint.
- SOCKS5/SSH-style local forwarding routes are blocked until a thumbprint is recorded.
- Pre-check attempts to discover the RDP TLS certificate thumbprint automatically.
- Certificate probing first uses RDP negotiation and then falls back to direct TLS, with stage-specific failure messages.
- If no thumbprint is pinned yet, a successful probe stores it.
- If a later probe sees a different thumbprint, the server is marked
CertificateChanged. - CSV import recognizes
thumbprint,certificate, orcertThumbprint.
Search syntax examples:
tag:production os:2008
status:offline proxy:socks5
group:Production owner:Ops
web status:online
Connection logging:
- Each connection attempt records time, server, target address, proxy mode, DPI mode, route summary, and result.
- The local log keeps the latest 1000 records.
- The selected server detail panel shows recent connection history for that
server, matched by server id or
host:port. - The connection history window provides a full searchable table across all connection records.
- Current MVP records launch success or adapter failure; session duration can be added after the embedded RDP ActiveX host is implemented.
Audit logging:
- Add, edit, delete, import, export, restore, settings, connect, pre-check, and batch probe operations are written to SQLite.
- Recent audit entries are visible in the main detail panel.
- The audit log window provides a full searchable table across all audit entries.
- Audit entries are also mirrored into
app.logwith anAUDITprefix.
Group management:
- The group management window lists current groups and servers.
- Operators can move a selected server to a new group.
- Operators can rename a group path across matching servers.
UI polish:
- Connection history and audit windows include searchable tables, consistent table borders, tooltips, and empty-state messages.
- Restore uses a dedicated preview dialog instead of a destructive confirmation prompt.
Alert center:
- Pre-check and batch check generate alerts for offline, RDP port closed, certificate changed, proxy unavailable, slow response, and related states.
- Alert rules in settings control failure-count threshold, slow-response threshold, and whether ping, RDP port, certificate change, and slow response alerts are enabled.
- Returning to
Onlineautomatically resolves open alerts for that server. - The dashboard shows the current open alert count and recent open alerts.
- The alert center can filter alerts, acknowledge them, silence them for one hour, or resolve them manually.
Backup and restore:
- Toolbar actions export or restore
*.rdpcc-backup.jsonpackages. - Packages include servers, connection logs, alerts, audit logs, package version, and export time.
- Restore validates package version, server hosts, and duplicate endpoints before applying changes.
- Restore opens a preview window showing package counts and export time before the operator confirms.
- When enabled, restore first writes an automatic backup under
%LOCALAPPDATA%\RdpCommandCenter\Backups. - Automatic backups are pruned by the configured retention count.
- Passwords remain DPAPI-encrypted in the package. They are intended to restore for the same Windows user profile.
Runtime diagnostics:
- Startup and unhandled exceptions are written to
%LOCALAPPDATA%\RdpCommandCenter\app.log. - The app has been smoke-tested to stay alive for at least 5 seconds after startup in the local desktop environment.
- The P0 smoke test starts the WPF executable, waits 5 seconds, then closes it cleanly.
Settings center:
- Default port, username, group, and DPI preference.
- Pre-check timeout and log retention days.
- Optional background monitoring and monitoring interval.
- Background monitoring concurrency.
- Alert rule controls for failure count, slow response threshold, and alert type switches.
- Restore safety controls for automatic backup-before-restore and automatic backup retention count.
- Enforce certificate thumbprint for tunneled/proxied routes.
- Prefer external
mstsc.exeinstead of embedded ActiveX. This startup strategy applies on the next app launch.
Background monitoring:
- Disabled by default.
- When enabled, the app periodically checks all servers with the same Ping/TCP and certificate logic used by manual pre-check.
- Alerts are generated or resolved automatically during background checks.
Roadmap priority:
- P0 completed: SQLite normalized projection columns and indexes, real WPF startup smoke test, unified error dialog.
- P1 later: permission and role model.
- P2 later: connection history and audit log export.
CLI maintenance:
dotnet RdpManager.Cli\bin\Debug\net8.0-windows\RdpManager.Cli.dll set-credential <host> <port> <username> <password>This updates the matching local server record with a DPAPI-encrypted password.
- Host Microsoft RDP ActiveX inside WPF through
WindowsFormsHost. - Feed
RdpConnectionSettings.RdpHostForControl,RdpPortForControl, andRdpPropertiesinto the RDP adapter. - Add a local TCP forwarder for SOCKS5 and SSH tunnel profiles.
- Store groups, servers, DPI profiles, monitor profiles, and proxy profiles in SQLite.
- Store credentials with Windows DPAPI or Windows Credential Manager.
- Replace sample monitoring snapshots with ping, TCP 3389, and RDP handshake probes.
- Add certificate thumbprint pinning before allowing proxied RDP sessions.
cd D:\codex\rdp\RdpManager
dotnet buildThe project targets net8.0-windows and uses WPF.