question

JimRyan-2423 avatar image
0 Votes"
JimRyan-2423 asked 27731119 answered

Enable RDP on headless server with no user logged in

I just built a Server 2019 box. I want this in a closet headless. So I need to be able to RDP into it to manage it. For some reason I cannot connect to it unless I physically log in as a user first. In other words, after a fresh boot, if I try to connect into it I can't as it thinks RDP is not running. But if I go to it, connect a keyboard and mouse and login, then I can go to my system and RDP in. This is not true in Server 2012. How do I make this work? Do I need to setup a user to auto-login? This seems like a security no-no.

remote-desktop-serviceswindows-server-2019
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

JennyYan-MSFT avatar image
0 Votes"
JennyYan-MSFT answered


Hi,
In my testing VM, there is no need to sign into the Server 2019 first before successfully remoting but just turning on the server.

Therefore, could you please help to confirm the exact error message when you failed to remote to the server?

If possible, please also check if any event logs have been recorded for RDP failure in both client and server side.

Event log checking:

TerminalServices-RemoteConnectionManager and TerminalServices-LocalSessionManager logs to view information about connections.

Step 1: Press Windows+R to open the Run dialog, enter eventvwr (or eventvwr.msc) and hit OK.

Step 2: Navigate to Event Viewer\ Applications and Services Logs\ Microsoft\ Windows\ TerminalServices-*



If the Answer is helpful, please click Accept Answer and upvote it.

Thanks,
Jenny




5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

loupgarou24-3356 avatar image
0 Votes"
loupgarou24-3356 answered

this is the same issue I'm getting on my azure hci os on all four dell emc ax 640 machines. (latest one. built 3 weeks ago).

after a fresh restart.

a) in windows admin center. i notice the logged in user count is -1
b) if the console user logs in (press ctrl alt del) then you are able to connect to rdp remotely.
c) if during the reboot cycle you spam rdp so that you can try to get in asap. you sometimes will be able to do so.
d) (if after you do log in. and you disconnect),. it works perfectly fine. windows admin center will show logged in user count of 0.
e) if on the other hand you do a LOG out. the logged in user count goes to -1

event log will show event id 40m terminalservices-localsessionmanager
session 3 has been disconnected, reason code 12.

reason code 12 if you search for it is "Code 12 is registered when the disconnection was initiated by the user logging off their session on the machine, such as logging out via the start menu."

however, powershell remoting works. so you can just log in powershell via server manager or windows admin center
so the only thing i can't really do is run sconfig but its no big deal.

I'm testing if configuring autoadminlogon (so that after a reboot, the server auto logs on, and thus establishing a rdp session that you can remotely log in to).

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.