Microsoft KB Archive/284439

= Using the Terminal Services Advanced Client to Troubleshoot Terminal Services Disconnection Issues =

PSS ID Number: 284439

Article Last Modified on 5/28/2003

-

The information in this article applies to:


 * Microsoft Windows NT Server 4.0 Terminal Server Edition
 * Microsoft Windows 2000 Server SP1
 * Microsoft Windows 2000 Advanced Server SP1
 * Microsoft Windows 2000 Datacenter Server

-



This article was previously published under Q284439



SUMMARY
If you have difficulty maintaining a Terminal Services session, you can use the Terminal Services Advanced Client (TSAC) to troubleshoot disconnected sessions. You can use TSAC to troubleshoot the following types of sessions:
 * A Terminal Server session between a client and a computer that is running Windows NT Server 4.0, Terminal Server Edition.
 * A Terminal Services session between a client and a computer that is running Windows 2000 Server with Terminal Services enabled.



MORE INFORMATION
To use TSAC to troubleshoot a disconnected Terminal Services session:  Download and install the TSAC Web package from the following Microsoft Web site:

http://www.microsoft.com/windows2000/downloads/recommended/tsac/default.asp

 Run Tswebsetup.exe on a server on which Microsoft Internet Information Server 4.0 or later is installed. You should install the TSAC Web package on a server that is not experiencing connection issues. In the Inetpub\Wwwroot\Tsweb folder, create a backup copy called Connect-backup.asp of the Connect.asp page.  Find the following code in the Connect.asp page: sub MsTsc_OnDisconnected(disconnectCode) if not disconnectCode = 2 then msgbox ErrMsgText & MsTsc.Server end if     'redirect back to login page Window.Navigate(&quot;default.htm&quot;) end sub Replace that code with the following code: sub MsTsc_OnDisconnected(disconnectCode) msgbox ErrMsgText & MsTsc.Server & &quot;disconnect code: &quot; & disconnectCode end sub This modifies the OnDisconnected handler in the default.htm page so that the default.htm page displays the disconnect code.  Browse to the Terminal Services Web Connections page. The page is in the following location (where  is the name of the server on which you ran Tswebsetup.exe):

http:// /tsweb

NOTE: If the problem appears to originate on a workstation or a remote connection such a VPN, this step should be performed from that location. In the Server box, type the name of the server that is experiencing connection issues, and then click Connect.</li> After the session is established, either wait for the session to disconnect or attempt to reproduce the original disconnection. When the session disconnects, a disconnect code is displayed in an error message on the client computer. Match the disconnect code with the reason for the disconnection in the following table.

<pre class="fixed_text">Disconnect Code  Reason for the Disconnection

=
================================================== 1                Local disconnection (not an error) 2                Remote disconnection by user (not an error) 3                Remote disconnection by server (not an error) 260              DNS lookup failed 262              Out of memory condition 264              Connection timed out 516              WinSock socket connect failed 518              Out of memory condition 520              Host not found error (GetHostByName failed) 772              WinSock send call failed 774              Out of memory condition 776              Invalid IP address specified 1028             WinSock recv call failed 1030             Invalid security data 1032             Internal error (code 1032) 1286             Invalid encryption method 1288             DNS lookup failed 1540             GetHostByName call failed 1542             Invalid server security data 1544             Internal error (timer error) 1796             Time-out occurred 1798             Failed to unpack server certificate 2052             Bad IP address specified 2054             Internal security error 2308             Socket closed 2310             Internal security error 2566             Internal security error 2822             Encryption error 3078             Decryption error

</li></ol>

For more information about how to script TSAC, please see the &quot;Scripting the Terminal Services Advanced Client&quot; document at the following Microsoft Developer Network (MSDN) Web site:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwts/html/w2ktsac.asp

Important As of April 2003, a newer remote desktop Web client is available. To obtain this Web client, visit the following Microsoft Web site:

http://www.microsoft.com/windowsxp/pro/downloads/rdwebconn.asp

To enable advanced error reporting for this new and different ActiveX client, remark (REM) or comment out the following lines as shown below: '  if (disconnectCode = &hB08 or majorDiscReason = 2 or majorDiscReason = 1) and not (extendedDiscReason = 5) then

'     'Switch back to login area

'     ReturnToConnectPage

'     exit sub

'  end if

Additional query words: Disconnect RDP

Keywords: kbhowto kbTermServ w2000wts KB284439

Technology: kbNTTermServ400 kbNTTermServSearch kbwin2000AdvServ kbwin2000AdvServSearch kbWin2000AdvServSP1 kbwin2000DataServ kbwin2000DataServSearch kbwin2000Search kbwin2000Serv kbwin2000ServSearch kbwin2000ServSP1 kbWinAdvServSearch kbWinDataServSearch kbWinNT400search kbWinNTS400search kbWinNTsearch kbWinNTSsearch

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© 2003 Microsoft Corporation. All rights reserved.