Powershell/Windows Server/New-RdsCertificat.ps1
2023-07-04 12:59:44 +02:00

6 lines
415 B
PowerShell
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

New-SelfSignedCertificate -Subject CertName -DnsName "CertFqdn” -CertStoreLocation “cert:\LocalMachine\My” -KeyAlgorithm RSA -KeyLength 2048 -KeyExportPolicy Exportable -NotAfter (Get-Date).AddYears(5)
$pwd = ConvertTo-SecureString -String "Password" -Force AsPlainText
Export-PfxCertificate -cert cert:\localMachine\my\785810C7545A00609AA3623159DA3E6E01F265DB -FilePath e:\cert.pfx -Password $pwd