Issue (discreason=4) for using MSTSC dll on Windows Server 2016. RRS feed

  • Question

  • Hello Team,

    We are working on Windows Server 2016 RDP connection using AxMSTscLib dll.

    We are using AxMSTSCLib.AxMsRdpClient6NotSafeForScripting object for connection.

    Once we call connect method, after some time OnDisconnected event gets fired instead of OnConnected.

    We get following information from OnDisconnected event:

    • The disconnect reason:  e.discReason = 4.
    • Extended disconnect reason: axMsTscAx1.ExtendedDisconnectReason = exDiscReasonNoInfo.
    • We tried to get more details using API GetErrorDescription but it just gives us “An internal error has occurred.” error description which seems to be of no use.

    Additional information:

    • RDP version on Windows Server 2016 is 10.2.
    • The same code found to be working on Windows Server 2012.

    Can anyone help us to find out the reason why its failing on Server 2016? OR is there any other settings/API that we need to use on Server 2016?

    Code snippet:

    private AxMSTSCLib.AxMsRdpClient6NotSafeForScripting axMsTscAx1;

    this.axMsTscAx1 = new AxMSTSCLib.AxMsRdpClient6NotSafeForScripting();

    this.axMsTscAx1.OnConnected += new System.EventHandler(this.OnConnected);
    this.axMsTscAx1.OnDisconnected += new AxMSTSCLib.IMsTscAxEvents_OnDisconnectedEventHandler(this.OnDisconnected);

    axMsTscAx1.DesktopWidth = Screen.PrimaryScreen.WorkingArea.Width;
    axMsTscAx1.DesktopHeight = Screen.PrimaryScreen.WorkingArea.Height;
    axMsTscAx1.Server = _hostPCName;
    axMsTscAx1.UserName = _userAccount;

    MSTSCLib.ITSRemoteProgram remoteProgram = axMsTscAx1.RemoteProgram;

    remoteProgram.RemoteProgramMode = true;

    MSTSCLib.IMsRdpClientAdvancedSettings6 clientAdvSettings = axMsTscAx1.AdvancedSettings7;

    clientAdvSettings.ClearTextPassword = _commandLinePasswordEncrypted ? Encryption.DecryptString(_userPassword) : _userPassword;
    clientAdvSettings.SmartSizing = true; //Windows just get scaled
    clientAdvSettings.EnableCredSspSupport = true;


    Thanks in advance.



    • Edited by shaileshSSG Thursday, November 30, 2017 7:07 AM
    Thursday, November 23, 2017 2:20 PM