DeploymentSettings or RDS arguments empty for (new) remote desktop collection

I needed to create a additional collection on the connection broker for a test environment. When the pool was created on the connection broker, when download the .rdp file from the RDWeb the .rdp file would be missing a lot of details and the computername field also would be empty.

I’ve tried a lot of troubleshooting steps found online but none of them helped.
I then figured out that, in the registry “Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Terminal Server\CentralPublishedResources\PublishedFarms\PoolName\DeploymentSettings” the REG_BINARY ‘CertificateHash’ was missing, as well as the ‘Signature’ part in the RDP file.

So i figured it could be a certificate issue, I checked the local certificate manager and indeed found out that the installed certificate was expired.
I started powershell and ran;

import-Module C:\Windows\System32\ServerManagerInternal\RDManagement\RDManagement.psd1

So the certificates used were expired. I copied the new .pfx file to the server and ran;

$password = "password for pfx file"
$Pass = ConvertTo-SecureString $assword -AsPlainText -Force
Set-RDCertificate -Role RDPublishing -Pass $pass -ConnectionBroker -ImportPath "C:\ path to pfx"
Set-RDCertificate -Role RDRedirector -Pass $pass -ConnectionBroker -ImportPath "C:\ path to pfx"
Set-RDCertificate -Role RDWebAccess -Pass $pass -ConnectionBroker -ImportPath "C:\ path to pfx"

As soon as the certificates were renewed the faulty server collection started working correctly and the missing fields in the registry were filled.

I hope this helps someone!