Diagnosing Logon Delays

In this column, I discuss diagnosing and solving logon delays caused by three specific problems. I use the term logon delay to include the time it takes for the logon screen to disappear after you enter valid credentials, plus the time it takes for a Windows XP or Windows 2000 system to display the desktop after the logon box disappears. Logon delays can occur in three situations: when you log on interactively at a workstation or server, when you connect to a VPN server, and when you connect to resources on a standalone server that requires local credentials, rather than domain credentials. Profile problems are also a common source of logon delays, but they’re complicated and outside the scope of this discussion—a large profile or an inaccessible or corrupt profile can appear to hang a system or result in an empty desktop after a delay of 10 minutes or more.
Incorrect or empty DNS server address. The most common cause of a logon delay in a Win2K domain is an undefined or invalid TCP/IP address for the network DNS sever. The symptom for this problem is the familiar hourglass cursor hanging over the Welcome screen. When the hourglass appears, you might see the status message preparing network connections in the lower portion of the Welcome screen. When the local machine has no TCP/IP address for a DNS server or the address is invalid, the system might be unable to locate a domain controller (DC). When the local machine has a valid DNS server address, the address might point to a DNS server on the Internet or to a server across a slow WAN link. In both of these situations, the logon delay is caused by the forwarding and routing of a name-resolution request on a less than optimal path. For example, if the DNS name-resolution request goes to an ISP’s name server, the request must find a name server that knows the address of the DNS server on the internal network. To check the TCP/IP settings for a connection that's experiencing delays, simply open a command prompt and type the command

ipconfig/all

If you use the Ipconfig command without the /all parameter, the command displays a subset of TCP/IP information for the primary network adapter but not for multiple network adapters and active VPN connections. If the local machine is on a network and has only one network adapter, Ipconfig/all displays configuration information in two sections. The first group contains the machine’s DNS host name and DNS domain name (suffix); the WINS node type, whether or not routing is enabled (it's usually not enabled on a standard workstation or server); the WINS proxy address (typically blank); and a DNS domain search list, which might also be blank. On a standard workstation, the second section contains the TCP/IP configuration data for the network adapter. If a system has multiple adapters or active VPN connections, you’ll see multiple TCP/IP configuration groups, one for each network adapter and one for each VPN connection. If the DNS address is correct, you can use the Nslookup command to verify that the DNS server is online and accepting name-resolution requests. When Nslookup starts, it contacts the DNS server defined for the primary network adapter. If you have a multihomed system, the primary adapter is the first network card in the binding order. To view the bindings, click Start, Settings, Network and Dialup Connections, then select the Advanced menu and click Advanced Options. If the DNS server is online and available, Nslookup displays the DNS name and address for the server. If Nslookup can't contact the DNS server, you’ll see the name and address of the server, followed by a timeout message that indicates the server didn't respond in a timely manner.
Images created with Sysprep. If you use Sysprep to create Win2K images, a bug in the utility forces a Win2K workstation (and potentially an XP system) to download the full Group Policy Object (GPO) each time you log on to a Win2K domain. Under ordinary circumstances, a system downloads the GPO only when the policy has been modified. A logon delay can occur when a system downloads nested GPOs—in many cases, the policy refresh can take several minutes. The registry subkey below defines the maximum number of minutes a system should wait before downloading the full GPO. Sysprep incorrectly sets this value to 1 minute, which forces the system to reload the GPO at every logon. To correct this problem, start a registry editor and navigate to the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\GPExtensions\\{GUID\}\ subkey. Locate the value entry MaxNoGPOListChangesInterval, of type REG_DWORD. (Note: On my test system, the correct globally unique identifier—GUID—was the fifth key below GPExtensions. You might have to examine several of the subkeys to locate the MaxNoGPOListChangesInterval value entry.) If the value of this entry is 1, the system is a victim of the Sysprep bug. To restore typical operation, change MaxNoGPOListChangesInterval to the default value of 960 minutes—the equivalent hexadecimal value is 0x3C0. This change should eliminate logon delays that an unnecessary GPO refresh causes.
XP system bug. If you use a complex set of GPOs to govern your organization, a bug in XP and XP Service Pack 1 (SP1) systems can cause a system to hang after you enter valid credentials. If this is the cause of the logon delay, the system appears unresponsive when the Applying your personal settings message appears in the logon screen. Microsoft has a bug fix for this problem—a new version of userenv.dll, with a file release date of November 14, 2002. The fix is available only from Microsoft Product Support Services (PSS). When you talk to the support people, cite the Microsoft article "Computer Seems to Hang When You Log On" (http://support.microsoft.com/?kbid=329457).

Diagnostic Techniques
In addition to the Ipconfig/all and Nslookup commands, you can use two diagnostic techniques to troubleshoot the source of logon delays. Both techniques require that you modify the registry.
Verbose logon and logoff messages. Start by enabling the verbose message option for startup, shutdown, logon, and logoff activities. To enable this feature, start a registry editor and navigate to the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System subkey. Add a new value entry called VerboseStatus, of type REG_DWORD, with a value of 1. Log off, then log back on and search for clues in the additional messages in the System and Application event logs. The additional messages might help you identify the source of the problem. Remember to disable verbose mode before you return the system to production (simply delete the VerboseStatus value entry).
User environment debugging. User environment logging usually produces more valuable information, especially if the delay is related to GPO application. Using a registry editor, locate the HKEY_LOCAL_MACHINE\SOFTWARE \Microsoft\Windows NT\CurrentVersion\Winlogon subkey. Add a new value entry called UserEnvDebugLevel of type REG_DWORD, and give the entry a hex value of 10002 (0x00010002). This setting instructs the OS to write verbose messages for startup, shutdown, logon, and logoff activities to the log file %systemroot%\debug\usermode\userenv.log file. If you want to fine-tune the debugging messages, you can set the value of UserEnvDebugLevel to any combination of these values:

NONE 0x00000000
NORMAL 0x00000001
VERBOSE 0x00000002
LOGFILE 0x00010000
DEBUGGER 0x00020000

When you set the value to 10002, you instruct the OS to write verbose messages to the log. The default value of this value entry is NORMAL|LOGFILE (0x00010001). Log off and back on and check the log file; don’t let the amount of data you see overwhelm you—it’s easy to sift through the messages and locate the source of the problem. When you’re finished, you can either reset this value to zero or delete the UserEnvDebugLevel item.

Discuss this Article 12

Christopher E. Johnson (not verified)
on Feb 2, 2004
I found this article to be very informative but I would like to know what would cause a long delay in logging on using wireless cards(DWL-520) D-Link. When I disble the wireless card and enable the wire LAN, login is a snap. I have updated the drivers, talked to Microsoft and D-Link, exchanged cards and prayed to the wireless Gods but no one seems to know. If you have information, i would be forever in your debt.
Des Embrey (not verified)
on Mar 11, 2003
Do the registry changes for verbose logon an dlogoff messages and for user environment debugging work for that bane of all our existences, legacy Windows NT4 systems, as well?
Anonymous User (not verified)
on Mar 23, 2005
Very helpful. You helped me target my DNS problem and the logon process is way faster. Thank you!
Fritz Lang (not verified)
on May 3, 2004
My client's workstations suffered 5-minute logon delays until I resolved the DNS issue. The delay is now down to 3 seconds. Thanks for your help!
Rick Patterson (not verified)
on Nov 3, 2003
Paula... Thanks for article. I'll do some testing and see if some of your solutions address our issues. One thing that seems to help us with this issue on Windows XP is going to Properties on the LAN connection, deleting the Client for Microsoft Networks and File and Print sharing services, rebooting the PC and then adding the services back. On the next reboot, the problem is gone. Do you think this somhow forces the client PC to get a valid DNS entry from the DHCP server? Or why does this work?
Anonymous User (not verified)
on Dec 5, 2004
thanks alot!!!!!!!!!
Vince (not verified)
on Dec 14, 2003
I'm experiencing slow logons, and I use a dhcp on a linksys router, so the dns that is populated to the XP client is on the internet, should it point to the Domain Controller? You don't specify where the DNS should point to?

Please or Register to post comments.

IT/Dev Connections

Las Vegas
September 30th - October 4th

Paul ThurottYou'll have the opportunity to experience:
• The Microsoft
Technology Roadmap
• Office 365 Implementation
• Hyper-V Optimizing
• Windows 8 Deployment
and much more!

Come See Paul Thurrott & Rod Trent in Person!

Early Registration Now Open

Upcoming Training

Mastering SharePoint 2013: Succeeding, Not Just Surviving

Building on the success of the “Mastering SharePoint 2010” seminars, the presenters have updated the content to cover the latest and greatest SharePoint product: SharePoint 2013. While SharePoint 2013 is relatively new on the marketplace, the presenters have been working with SharePoint 2013 for well over a year, and have implemented it with a number of clients in production environments.

Register Now

Current Issue

May 2013 - The NameTranslate object is useful when you need to translate Active Directory object names between different formats, but it's awkward to use from PowerShell. Here's a PowerShell script that eliminates the awkwardness.

CURRENT ISSUE / ARCHIVE / SUBSCRIBE

Windows Forums

Get answers to questions, share tips, and engage with the Windows Community in our Forums.