1、生成自签名证书
$certname = "certnameTest" ## Replace {certificateName}
$cert = New-SelfSignedCertificate -Subject "CN=$certname" -CertStoreLocation "Cert:\CurrentUser\My" -KeyExportPolicy Exportable -KeySpec Signature -KeyLength 2048 -KeyAlgorithm RSA -HashAlgorithm SHA256 -NotAfter (Get-Date).AddMonths(600)
$mypwd = ConvertTo-SecureString -String "123456" -Force -AsPlainText ## Replace {myPassword}
Export-PfxCertificate -Cert $cert -FilePath "C:\$certname.pfx" -Password $mypwd ## Specify your preferred location
2、 导入certnameTest.pfx证书,存储类型:本地计算机。证书存储:自动选择证书存储
3、 certlm.msc 查看certnameTest证书,在个人->证书
4、 wmic 配置证书
SSLCertificateSHA1Hash 为指纹值
wmic /namespace:\\root\cimv2\TerminalServices PATH Win32_TSGeneralSetting Set SSLCertificateSHA1Hash="b37fa0aa79c41284b7d64fa1813d02fce7b2c850"
标签:存储,SSLCertificateSHA1Hash,证书,Windows,certname,##,certnameTest,远程
From: https://www.cnblogs.com/marit/p/17601677.html