0

I am trying to create a remote desktop child session. I can successfully create one on my laptop. I tried on AWS with Windows Server 2016 Datacenter and it was failing. Calls to WTSEnableChildSessions and WTSIsChildSessionsEnabled returned false. However, after some time it started working and I don't know why, but I believe it has something to do with configuration. I am now trying to replicate on another server and failing.

My question is, what is needed to enable a child session?

Code I am using to create child session

Object obj = this.rdp.GetOcx();

IMsRdpClient8 msRdpClient = this.rdp.GetOcx() as IMsRdpClient8;
msRdpClient.AdvancedSettings9.EnableCredSspSupport = true;

MSTSCLib.IMsRdpExtendedSettings extSettings = rdp.GetOcx() as MSTSCLib.IMsRdpExtendedSettings;
extSettings.set_Property("ConnectToChildSession", True);

rdp.Connect();

I have gone through following links to no avail, did I miss anything
https://learn.microsoft.com/en-us/windows/win32/termserv/child-sessions
https://learn.microsoft.com/en-us/windows/win32/api/wtsapi32/nf-wtsapi32-wtsenablechildsessions
https://learn.microsoft.com/en-us/windows/win32/api/wtsapi32/nf-wtsapi32-wtsischildsessionsenabled

Raj
  • 1
  • 1
  • 1
    if proxy is set true (and no proxy) it take up to 30 seconds for a timeout to occur before the actual connection is attempted. Also you have to have the role setup properly (but this is linux so it may not be necessary). Did you try connecting using a RDP terminal instead of your c# code? – jdweng Feb 09 '21 at 14:27
  • @jdweng I can RDP the system without any issues. I am on windows, not sure about Linux permissions. – Raj Feb 09 '21 at 16:08
  • Can you RDP from same system as c# is running? What credentials are you using? T he c# should be using same credentials as the RDP terminal. The problem doesn't look like it is on the Linux side since you can login with RDP unless there is a version difference between the RDC and the c# library. What type machine are you using? If mobile application I would make sure the latest version of operating system and kernel are installed. – jdweng Feb 09 '21 at 16:59
  • A child session is created inside the existing user session and it does not require credentials. The C# code runs on the remote machine and creates a loopback remote desktop session on the same machine. – Raj Feb 10 '21 at 08:08
  • The server has a firewall and even though you are on same machine you still have to go through the firewall. – jdweng Feb 10 '21 at 10:52

0 Answers0