lima-city: Webhosting, Domains und Cloud
0 Pluspunkte 0 Minuspunkte

Ich habe versucht mit diesem Script das Serverzertifikat für RDP in der Registry auf Windows 10 einzutragen.

$thumbprint = (Get-ChildItem Cert:\LocalMachine\My | Where-Object {$_.Subject -eq "CN=server1.dom.local"}).Thumbprint
Set-ItemProperty -Path "HKLM:\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" -Name "SSLCertSHA1Hash" -Value $thumbprint

Aber selbst nach einem Neustart verwendert der Server noch immer das selbst signierte Zertifikat wenn ich es mit OpenSSl teste.

von  

1 Antwort

0 Pluspunkte 0 Minuspunkte

Auf älteren Windows Versionen (oder auch Windows 10) muss man 2 Werte setzen, einmal den Fingerabdruck als String (SSLCertSHA1Hash) und einmal als binären Wert (SSLCertificateSHA1Hash).

$thumbprint = (Get-ChildItem Cert:\LocalMachine\My | Where-Object {$_.Subject -like "*server1.dom.local*"}).Thumbprint

# String-Wert setzen
Set-ItemProperty -Path "HKLM:\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" -Name "SSLCertSHA1Hash" -Value $thumbprint

# Binary-Wert setzen
$binThumbprint = ($thumbprint -replace ' ', '') -split '(..)' | Where-Object { $_ } | ForEach-Object { [Convert]::ToByte($_, 16) }
Set-ItemProperty -Path "HKLM:\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" -Name "SSLCertificateSHA1Hash" -Value ([byte[]]$binThumbprint)

Restart-Service TermService -Force
von (1.3k Punkte)