A common issue seen with 2019 RDS sessions is a broken Start Menu. You click and nothing appears. For the longest time and troubleshooting it was looking like errors with the AppX Metro engine. Re-registering AppX apps would sometimes fix the problem, but only for a short period of time.
But we were wrong. Sort of.
It actually is due to App Containers getting added to Firewall Policies on the system. As those apps get registered with sessions the list gets longer, longer, and longer. Until it gets to the point when enumeration times out. So the fix is to enable the deletion of those containers on user logoff, and to clear out all the old entries. Running these commands will take some time to process on systems with frequent logins. But it’s a one time run and fix.
Copy the entries below and paste them into an admin powershell on persistent machines. On non-persistent machines paste these into the maintenance machine. But most non-persistent machines won’t exhibit these types of issues often.
reg delete HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\FirewallRules /va /f
reg delete HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\RestrictedServices\Configurable\System /va /f
reg delete HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\RestrictedServices\AppIso\FirewallRules /va /f
reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy /v DeleteUserAppContainersOnLogoff /t REG_DWORD /d 1