diff --git a/RDPSign.ps1 b/RDPSign.ps1 index 6ee1c44..8cb9805 100644 --- a/RDPSign.ps1 +++ b/RDPSign.ps1 @@ -1,5 +1,7 @@ -# ============================================================================== +#Requires -RunAsAdministrator +# ============================================================================== # SIGN RDP CONNECTION FILES YOU CREATE ON THE MACHINE USING A SELF-SIGNED CERTIFICATE TO SUPRESS APRIL 2026 RDP SECURITY UPDATE WARNINGS WHEN OPENING REMOTE DESKTOP FILES +# This file should be run on the machine you are connecting FROM. # https://learn.microsoft.com/en-us/windows-server/remote/remote-desktop-services/remotepc/understanding-security-warnings#:~:text=When%20an%20RDP%20file%20is,as%20the%20following%20image%20shows. # https://msrc.microsoft.com/update-guide/vulnerability/CVE-2026-26151 # NOTE!! THIS WILL NO LONGER SHOW THE "Remote Desktop Connection security warning" FOR ANY SIGNED FILES AND ENSURES THESE FILES CAN'T BE MODIFIED AFTER SIGNING WITHOUT INVALIDATING THE SIGNATURE, WHICH WILL MAKE THE WARNING REAPPAER @@ -9,8 +11,18 @@ # ============================================================================== # 1. Configuration -$rdpFile = "C:\Users\Desktop\RDPFILENAME.rdp" -$certSubjectName = "CompanyNameIT-RDP" + +Add-Type -AssemblyName System.Windows.Forms + +$folderselection = New-Object System.Windows.Forms.OpenFileDialog -Property @{ +InitialDirectory = [Environment]::GetFolderPath('Desktop') +Filter = "RDP Files (*.rdp)|*.rdp" +} +$folderselection.ShowDialog() + + +$rdpFile = $folderselection.Filename +$certSubjectName = $env:computername+"-RDP" $certSubject = "CN=$certSubjectName" # 2. Check for existing certificate @@ -75,4 +87,4 @@ if (Test-Path $rdpFile) { Write-Host "Success! RDP file is ready for use." -ForegroundColor Green } else { Write-Error "Target RDP file not found at $rdpFile" -} \ No newline at end of file +}