1

I have a strange problem with using RemoteApp ActiveX...

Background: I'm trying to load test our Remote Desktop Session Host, in a particular scenario of running our GUI application via RemoteApp. Mostly the maximum user density in this scenario is of interest as we've seen in our production environment that users start getting RemoteApp connection errors when the user count on Session Host reaches ~450 (with CPU and memory faaar from maxing out).

So, in order to reproduce/debug the issue I want to set up a sample test that will:

  1. Have test users (User1..User2..User3...User1000) on Client host, when connecting to Server host (RD Session Host) to invoke their own RemoteApp instance/session
  2. The connection load will increase gradually, as we will launch one more user every X seconds on Client host

I have implemented a simple C# application that tries to invoke multiple RemoteApp sessions under different user accounts. (We've pre-generated 1000 user account for that)

Problem is: If I create sessions one after another, the first session that runs RemoteApp is authenticated properly under User1, the following invoked sessions, even if I supply different credentials (User2, User3, and so on) are run, but still authenticated under same User1 (but I would expect it to be User2, User3 and so on...). So I basically on Server side (RD Session Host side) see only User1 logged in with multiple copies of the app running under it.

So something somewhere caches the username, but I have no idea where :(

The code behind is:

Main loop:

    for (int i = from; i < to; i++)
    {
        LaunchRDPSnapIn(i);
        Thread.Sleep(period);
    }

Launcher function:

    static void LaunchRDPSnapIn(int number)
    {
        var rdpFileName = "SomeRemoteAppFile.rdp";
        var rdpFileContents = File.ReadAllText(rdpFileName);
        var rdpFile = new RDPFile(rdpFileContents);

        var msRdpClientShellType = Type.GetTypeFromProgID("MsRdpWebAccess.MsRdpClientShell");
        if (msRdpClientShellType != null)
        {
            dynamic shell = Activator.CreateInstance(msRdpClientShellType);
            dynamic workspace = shell.MsRdpWorkspace2;
            var result = workspace.StartWorkspaceEx(
                rdpFile.WorkspaceId+number,
                "RDPStressSession",
                rdpFile.FullAddress,
                "User" + number + "@domain.com", // Username is updated each time
                "SomePassword",
                "1E715D4A1234A0DDAF06E946AFB66F7045A4D12345",
                20,
                4);

            shell.RdpFileContents = rdpFileContents;
            shell.PublicMode = false;
            shell.Launch();
        }
    }

As a result of launching the above code all session created are created under first authenticated user (in this case it's User1@domain.com)

It's quite interesting although I do supply credentials to workspace, it's not honoring it. Any advise welcome.

Thanks.

Igor Malin
  • 582
  • 1
  • 7
  • 24
  • Hi Igor. I am on the RDS team. Can you please write an email to Catalin.David and NirajA @ microsoft with this information (and probably more: OS version, whether you are using broker, other details about your setup). Thanks! – cdavid Jul 30 '15 at 08:09
  • Sure, I will. Thank you David. You might as well be interested in results of our stress testing if we will get RemoteApp stress test working. – Igor Malin Jul 30 '15 at 20:55
  • I'm interested in solving a similar problem. Is anyone on this thread interested and able to share the solution? – logicaldiagram May 06 '16 at 13:30
  • I was unable to find a solution for this unfortunately... – Igor Malin May 08 '16 at 23:48

0 Answers0