This commit is contained in:
yois615 2026-04-29 11:50:38 -04:00 committed by GitHub
commit 67a25c8a09
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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"
}
}