Hello,
May I know if the firewall on your server is turned on?
Make sure the Windows Firewall service is started and running during the installation process. When the firewall service stops, the installer cannot add the necessary firewall exceptions to complete the installation process.
After the firewall is enabled, try redeploying. If the error persists, use the PowerShell command to complete the failed operation:
$tss = Get-WmiObject -namespace root\cimv2\terminalservices -class Win32_TerminalServiceSetting
$tss.SetAllowTSConnections(1,0)
Reference: Adding Remote Desktop Services role fails - Windows Server | Microsoft Learn
I hope this helps. If you have any further questions, please contact us.
Best regards
Jacen