Created
April 15, 2022 14:23
-
-
Save Alives/8b2ba6f218be9c1eedc9997048084a5e to your computer and use it in GitHub Desktop.
Set a 10 year self-signed RDP (Remote Desktop) cert
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$date_now = Get-Date | |
$extended_date = $date_now.AddYears(10) | |
$cert = New-SelfSignedCertificate -certstorelocation cert:\localmachine\my -notafter $extended_date -dnsname <your dns name> -KeyAlgorithm RSA -KeyLength 4096 | |
Get-ChildItem -Path Cert:LocalMachine\MY | Select-Object FriendlyName, Thumbprint, Subject, NotBefore, NotAfter | |
wmic /namespace:\\root\cimv2\TerminalServices PATH Win32_TSGeneralSetting Set SSLCertificateSHA1Hash="<your thumbprint>" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment