Merge d2f77e3cbf into bc3b87dd76
This commit is contained in:
commit
67a25c8a09
1 changed files with 16 additions and 4 deletions
20
RDPSign.ps1
20
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
|
# 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://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
|
# 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
|
# 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
|
# 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"
|
$certSubject = "CN=$certSubjectName"
|
||||||
|
|
||||||
# 2. Check for existing certificate
|
# 2. Check for existing certificate
|
||||||
|
|
@ -75,4 +87,4 @@ if (Test-Path $rdpFile) {
|
||||||
Write-Host "Success! RDP file is ready for use." -ForegroundColor Green
|
Write-Host "Success! RDP file is ready for use." -ForegroundColor Green
|
||||||
} else {
|
} else {
|
||||||
Write-Error "Target RDP file not found at $rdpFile"
|
Write-Error "Target RDP file not found at $rdpFile"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue