To change Remote Desktop certificate in Windows Server 2012R2 you need to do two steps:
Step 1. Get thumbprint of certificate (the name of certificate must be equal of server connection name). It possible from mmc.exe console (add certificates snap-in from computer account and view certificate in personal folder). Copy thumbprint without spaces and special symbol in start of line.
Step 2. Assign certificate from powershell:
$path = (Get-WmiObject -class “Win32_TSGeneralSetting” -Namespace rootcimv2terminalservices -Filter “TerminalName=’RDP-tcp'”).__path
Set-WmiInstance -Path $path -argument @{SSLCertificateSHA1Hash=”THUMBPRINT”} ## in THUMBPRINT pole add value from step 1.
Set-WmiInstance -Path $path -argument @{SSLCertificateSHA1Hash=”THUMBPRINT”} ## in THUMBPRINT pole add value from step 1.