Post-renewal script for binding new certificate to Remote Desktop Gateway

Here is the post renewal script that works for me. It updates the 4 core certificates associated with remote desktop services; specifically remoteapp deployments.

THis is done on 2012r2. The RDS path is only available on newer versions of windows server…

param($result)

Import-Module RemoteDesktopServices
Import-Module RemoteDesktop

#Set the certificate for the 4 core RDS services
Set-RDCertificate -Role RDGateway -ImportPath $result.ManagedItem.CertificatePath -Force
Set-RDCertificate -Role RDWebAccess -ImportPath $result.ManagedItem.CertificatePath -Force
Set-RDCertificate -Role RDRedirector -ImportPath $result.ManagedItem.CertificatePath -Force
Set-RDCertificate -Role RDPublishing -ImportPath $result.ManagedItem.CertificatePath -Force

1 Like