Unable to use Remote Desktop
When I used the remote desktop function in Windows admin center, I was always in the loading state and did not response. Whether Chreme or Edge's browser console displays:
PUT https://localhost/api/nodes/192.168.43.4/features/powershell Api/pssessions/instantSession 400
Msft. sme. remote - desktop -- appErrorHandler -- Ajax error 400
Google Chrome 70.0.3538.110
Microsoft Edge 44.17763.1.0
The remote desktop software can be connected normally.
Windows admin center installed in Win10
The server is Windows Server 2019 Core
FYI, I am running Server 2016. It's possible that the location of "$RdpGroupPolicyRegistryKey" is different for different versions, one can simply examine the payload of the failed request (the one that Jan mentions) to find the script that's run on the server. It has Get-RemoteDesktopSettings.ps1 at the beginning, and the failure is in the functions Get-RdpNlaGroupPolicySettings and Get-RdpGroupPolicySettings.
I have a workaround that I found solved this issue. The problem is that the server attempts to run the command
"Get-Member -InputObject $registryKey "
when $registryKey is null. This is because
"$registryKey = Get-ItemProperty -Path $RdpGroupPolicyRegistryKey -ErrorAction SilentlyContinue"
and the $RdpGroupPolicyRegistryKey has no entries (I'm guessing if the group policy isn't set)
To work around this, just put any dummy key into the location of $RdpGroupPolicyRegistryKey, which is probably "HKLM:\\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services", which causes the Get-ItemProperty command to not return null.
After doing this, I had no trouble with the in-browser remote desktop.
i forgot to say it happens on every browser: ff, chrome and edge
I have that same error:
HTTP400: WRONG REQUEST — server can not process the request due to an incorrect syntax.
(XHR)PUT — https://10.1.50.2/api/nodes/domsrvhvm01/features/powershellApi/pssessions/instantSession
Error -- msft.sme.remote-desktop -- appErrorHandler -- ajax error 400
more detailed info return from request: