Write-Host "`n=====================================================" -ForegroundColor Cyan Write-Host " RDP STATUS REPORT" -ForegroundColor Cyan Write-Host "=====================================================" -ForegroundColor Cyan Write-Host "TermService : $termStatus" -ForegroundColor $(if ($termStatus -eq 'Running') 'Green' else 'Red' ) Write-Host "UmRdpService : $umrpStatus" -ForegroundColor $(if ($umrpStatus -eq 'Running') 'Green' else 'Red' ) if (Test-Path $RDPConfPath) Write-Host "`n[INFO] Launching RDP Wrapper Configuration..." -ForegroundColor Yellow Start-Process $RDPConfPath else Write-Host "[WARN] RDPConf.exe not found." -ForegroundColor Yellow
pause @echo off title RDP Wrapper Access Denied Fixer echo Requesting administrator privileges... powershell -Command "Start-Process '%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe' -Verb RunAs -ArgumentList '-ExecutionPolicy Bypass -File \"%~dp0RDPWrapperFix.ps1\"'" pause 📝 Configuration File: config.ini (Optional) [RDPWrapper] ; Custom path to termsrv.dll if Windows is installed on different drive termsrv_path = C:\Windows\System32\termsrv.dll ; Custom RDP port (default 3389) rdp_port = 3389 rdp wrapper access denied
Write-Host "`n[INFO] If you still see 'Access Denied':" -ForegroundColor Yellow Write-Host "1. Disable Windows Defender Real-time protection temporarily" -ForegroundColor Gray Write-Host "2. Add exclusion for $RDPWrapperPath in antivirus" -ForegroundColor Gray Write-Host "3. Reboot and run this tool again" -ForegroundColor Gray rdp wrapper access denied
Write-Host "[OK] RDP Wrapper installation detected." -ForegroundColor Green Write-Host "[INFO] Stopping Remote Desktop Services..." -ForegroundColor Yellow Stop-Service TermService -Force -ErrorAction SilentlyContinue Stop-Service UmRdpService -Force -ErrorAction SilentlyContinue Step 3: Check termsrv.dll permissions (common "Access Denied" fix) Write-Host "[CHECK] termsrv.dll permissions..." -ForegroundColor Yellow $acl = Get-Acl $TermsrvPath $rule = $acl.Access | Where-Object $_.IdentityReference -eq "NT SERVICE\TermService" if (-not $rule) Write-Host "[FIX] Adding TermService permission to termsrv.dll" -ForegroundColor Green $rule = New-Object System.Security.AccessControl.FileSystemAccessRule("NT SERVICE\TermService", "ReadAndExecute", "Allow") $acl.AddAccessRule($rule) Set-Acl $TermsrvPath $acl else Write-Host "[OK] TermService permissions correct." -ForegroundColor Green Step 4: Backup and replace rdpwrap.ini with latest version Write-Host "[CHECK] rdpwrap.ini version..." -ForegroundColor Yellow $backupIni = "$RDPWrapperPath\rdpwrap.ini.backup" if (Test-Path $RDPWrapIni) Copy-Item $RDPWrapIni $backupIni -Force Write-Host "[BACKUP] Saved old rdpwrap.ini to $backupIni" -ForegroundColor Cyan Download latest rdpwrap.ini from GitHub (if internet available) $latestIniUrl = "https://raw.githubusercontent.com/sebaxakerhtc/rdpwrap.ini/master/rdpwrap.ini" try Invoke-WebRequest -Uri $latestIniUrl -OutFile "$env:TEMP\rdpwrap_new.ini" -ErrorAction Stop Copy-Item "$env:TEMP\rdpwrap_new.ini" $RDPWrapIni -Force Write-Host "[UPDATE] Downloaded latest rdpwrap.ini" -ForegroundColor Green catch Write-Host "[WARN] Could not download latest rdpwrap.ini. Using existing." -ForegroundColor Yellow Step 5: Re-register RDP Wrapper components Write-Host "[FIX] Reinstalling RDP Wrapper service..." -ForegroundColor Yellow & "$RDPWrapperPath\install.bat" -Force -Silent 2>&1 | Out-Null Step 6: Restart services Write-Host "[INFO] Restarting Remote Desktop Services..." -ForegroundColor Yellow Start-Service TermService -ErrorAction SilentlyContinue Start-Service UmRdpService -ErrorAction SilentlyContinue Step 7: Verify status Start-Sleep -Seconds 3 $termStatus = (Get-Service TermService).Status $umrpStatus = (Get-Service UmRdpService).Status rdp wrapper access denied