In Windows Server 2019, if you ever find yourself hit by a bug when you try to add the rds-web-access, then please follow these step;
Problem
In the eventlog
Install-WindowsFeature RDS-Web-Access -IncludeAllSubFeature
+ CategoryInfo : InvalidOperation: (@{Vhd=; Credent…Name=localhost}:PSObject) [Install-WindowsFeature],
Exception
+ FullyQualifiedErrorId : DISMAPI_Error__Failed_To_Enable_Updates,Microsoft.Windows.ServerManager.Commands.AddWindowsFeatureCommand
Step tried
- Installing with Server Manager GUI
- DISM /Online /Cleanup-Image /RestoreHealth
- DISM /Online /Cleanup-Image /RestoreHealth /Source:wim:D:\sources\install.wim:1 /limitaccess
- sfc /scannow
- Install-WindowsFeature RDS-Web-Access -source D:\sources\install.wim
- Install-WindowsFeature RDS-RD-Server -IncludeAllSubFeature will work at first, but revert the change at the reboot.
Issue
A previous installation of IIS is the culprit
Solution
Removing IIS:
After that; then you migh have to remove the IIS directory completly;
netsh http show urlacl
netsh http delete urlacl http://+:80/ netsh http delete urlacl https://+:443/