Investigating the situation
Sometimes the TS login process takes minutes instead of second to complete. The best point to start investigation is the debug log file.
In order to start debugging create or modify the following registry value:
Subkey: HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon
Value data: 0x00030002 (Hexadecimal)
This value gives the most verbose details logged in thefile.
The log file is written to the %Systemroot%\Debug\UserMode\file. If the file is larger than 300 KB, the file is renamed , and a new file is created. This action occurs when a user logs on locally or by using Terminal Services, and the Winlogon process starts. However, because the size check only occurs when a user logs on, the file may grow beyond the 300 KB limit.
Look at http://support.microsoft.com/kb/221833 for more details
Usually it is not very difficult to figure out what application or service causes the problem. However, sometimes the logon process takes almost forever and there is no clear indication in log file where the root cause of the problem is.
Logon process description
The logon process performs many operations; one of them is creating the profile folder for each and every user. The algorithm the following:
- If a user profile folder does not exist in C:\Documents and Settings, create a copy of Default User folder for a user
- If a user profile folder exists in location determined by GPO (“Computer Configuration -> Administrative Templates -> Windows Components -> Terminal Services -> Set path for TS Roaming Profiles”), copy all the file from this location over the user profile folder created from Default User profile
But what if a file in Default User profile is locked out by any process? Such file cannot be used to create a new user profile. The server waits until this file is released. Sometimes this waiting can take forever.
In order to check it out, try to copy Default User folder to another location. If one of the files cannot be copied, the root cause of the logon problem is found.
Use Process Explorer (http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx ) to find what process is locking out the file.
Pretty often I’ve seen that the killer process is, which is Indexing Service. This service is not really useful on Terminal server, so you can stop indexing for all volumes and stop and disable indexing service. Sometimes it helps to resolve the issue even without restating the server. Sometimes, especially when is not the only process trying to access files in the Default User folder, you will need to restart the server.