MORE INFORMATION
Warning Serious problems might occur if you modify the registry incorrectly by using Registry Editor or by using another method. These problems might require that you reinstall your operating system. Microsoft cannot guarantee that these problems can be solved. Modify the registry at your own risk.
Setting up to debug Net Logon on Windows NT 3.51
- CD %windir%\system32
- Rename Lsass.exe Lsass.fre
- Rename Lsasrv.dll Lsasrv.fre
- Rename Netlogon.dll Netlogon.free
- Copy the checked version of Lsass.exe, Lsasrv.dll and Netlogon.dll to the System32 directory. You can obtain the checked version from the DDK.
- CD %windir%
- MD debug
- Start Regedt32
- Change the REG_DWORD value of the following registry key to 2080FFFF, and then quit Regedt32.
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Netlogon\Parameters\DBFlag
Set up to debug Net Logon on Windows NT 4.0
- CD %windir%\system32.
- Rename Netlogon.dll Netlogon.free.
- Copy the checked version of Netlogon.dll to the system32 directory. You can obtain the checked version from the DDK.
- Start Regedt32.
- Delete the Reg_SZ value of the following registry entry, create a REG_DWORD value
with the same name, and then add the 2080FFFF hexadecimal value.
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Netlogon\Parameters\DBFlag
- Quit Regedt32, and then restart the server
- Confirm that the debug directory was created under the %windir%
directory and contains a Netlogon.log file.
Note A Netlogon 3051 eventlog error may be returned and the Net Logon service may not respond to start if the value entered for DBFlag is not entered as a hex value, for example, 0x2400ffff.
////////////////////////////////////////////////////////////////////////
//
// 3.5, 3.51 and 4.00 Debug flags and their values.
//
////////////////////////////////////////////////////////////////////////
#define NL_INIT 0x00000001 // Initialization
#define NL_MISC 0x00000002 // Misc debug
#define NL_LOGON 0x00000004 // Logon processing
#define NL_SYNC 0x00000008 // Synchronization and
replication
#define NL_MAILSLOT 0x00000010 // Mailslot messages
#define NL_PULSE 0x00000020 // Pulse processing
#define NL_CRITICAL 0x00000100 // Only real important errors
#define NL_SESSION_SETUP 0x00000200 // Trusted Domain maintenance
#define NL_DOMAIN 0x00000400 // Hosted Domain maintenance
#define NL_PACK 0x00000800 // Pack/Unpack of sync messages
#define NL_SERVER_SESS 0x00001000 // Server session maintenance
#define NL_CHANGELOG 0x00002000 // Change Log references
#define NL_DNS 0x00004000 // DNS name registration
//
// Very verbose bits
//
#define NL_DNS_MORE 0x00020000 // Verbose DNS name registration
#define NL_PULSE_MORE 0x00040000 // Verbose pulse processing
#define NL_SESSION_MORE 0x00080000 // Verbose session management
#define NL_REPL_TIME 0x00100000 // replication timing output
#define NL_REPL_OBJ_TIME 0x00200000 // replication objects get/set
timing
output
#define NL_ENCRYPT 0x00400000 // debug encrypt and decrypt
across
net
#define NL_SYNC_MORE 0x00800000 // additional replication
dbgprint
#define NL_PACK_VERBOSE 0x01000000 // Verbose Pack/Unpack
#define NL_MAILSLOT_TEXT 0x02000000 // Verbose Mailslot messages
#define NL_CHALLENGE_RES 0x04000000 // challenge response debug
#define NL_NETLIB 0x08000000 // Netlogon portion of Netlib
//
// Control bits.
//
#ifdef DONT_REQUIRE_ACCOUNT<BR/>
#define NL_DONT_REQUIRE_ACCOUNT 0x00020000 // Don't require
account on
DC discovery
#endif DONT_REQUIRE_ACCOUNT
#define NL_INHIBIT_CANCEL 0x10000000 // Don't cancel API calls
#define NL_TIMESTAMP 0x20000000 // TimeStamp each output line
#define NL_ONECHANGE_REPL 0x40000000 // Only replicate one change per
call
#define NL_BREAKPOINT 0x80000000 // Enter debugger on startup
////////////////////////////////////////////////////////////////////////
//
// 3.1 Debug flags and their values.
//
////////////////////////////////////////////////////////////////////////
#define NL_INIT 0x00000001 // Initialization
#define NL_MISC 0x00000002 // Misc debug
#define NL_LOGON 0x00000004 // Logon processing
#define NL_SYNC 0x00000008 // Synchronization and
replication
#define NL_MAILSLOT 0x00000010 // Mailslot messages
#define NL_PULSE 0x00000020 // Pulse processing
#define NL_CRITICAL 0x00000100 // Only real important errors
#define NL_SESSION_SETUP 0x00000200 // Trusted Domain maintenance
#define NL_PACK 0x00000800 // Pack/Unpack of sync messages
#define NL_SERVER_SESS 0x00001000 // Server session maintenance
#define NL_CHANGELOG 0x00002000 // Change Log references
//
// Very verbose bits
//
#define NL_PULSE_MORE 0x00040000 // Verbose pulse processing
#define NL_SESSION_MORE 0x00080000 // Verbose session management
#define NL_REPL_TIME 0x00100000 // replication timing output
#define NL_REPL_OBJ_TIME 0x00200000 // replication objects get/set
timing output
#define NL_ENCRYPT 0x00400000 // debug encrypt and decrypt
across net
#define NL_SYNC_MORE 0x00800000 // additional replication
dbgprint
#define NL_PACK_VERBOSE 0x01000000 // Verbose Pack/Unpack
#define NL_MAILSLOT_TEXT 0x02000000 // Verbose Mailslot messages
#define NL_CHALLENGE_RES 0x04000000 // challenge response debug
#define NL_NETLIB 0x08000000 // Netlogon portion of Netlib
//
// Control bits.
//
#define NL_INHIBIT_CANCEL 0x10000000 // Don't cancel API calls
#define NL_TIMESTAMP 0x20000000 // TimeStamp each output line
#define NL_ONECHANGE_REPL 0x40000000 // Only replicate one change per
call
#define NL_BREAKPOINT 0x80000000 // Enter debugger on startup
Opcode values that are returned in the Netlogon Logs for Troubleshooting
#define LOGON_REQUEST 0 // LM1.0/2.0 LOGON Request from
client
#define LOGON_RESPONSE 1 // LM1.0 Response to
LOGON_REQUEST
#define LOGON_CENTRAL_QUERY 2 // LM1.0 QUERY for centralized
init
#define LOGON_DISTRIB_QUERY 3 // LM1.0 QUERY for non-
centralized init
#define LOGON_CENTRAL_RESPONSE 4 // LM1.0 response to
LOGON_CENTRAL_QUERY
#define LOGON_DISTRIB_RESPONSE 5 // LM1.0 resp to
LOGON_DISTRIB_QUERY
#define LOGON_RESPONSE2 6 // LM2.0 Response to
LOGON_REQUEST
#define LOGON_PRIMARY_QUERY 7 // QUERY for Primary DC
#define LOGON_START_PRIMARY 8 // announce startup of Primary
DC
#define LOGON_FAIL_PRIMARY 9 // announce failed Primary DC
#define LOGON_UAS_CHANGE 10 // announce change to UAS or SAM
#define LOGON_NO_USER 11 // announce no user on machine
#define LOGON_PRIMARY_RESPONSE 12 // response to
LOGON_PRIMARY_QUERY
#define LOGON_RELOGON_RESPONSE 13 // LM1.0/2.0 resp to relogn
request
#define LOGON_WKSTINFO_RESPONSE 14 // LM1.0/2.0 resp to interrogate
request
#define LOGON_PAUSE_RESPONSE 15 // LM2.0 resp when NETLOGON is
paused
#define LOGON_USER_UNKNOWN 16 // LM2.0 response when user is
unknown
#define LOGON_UPDATE_ACCOUNT 17 // LM2.1 announce account
updates
#define LOGON_SAM_LOGON_REQUEST 18 // SAM LOGON request from client
#define LOGON_SAM_LOGON_RESPONSE 19 // SAM Response to SAM logon
request
#define LOGON_SAM_PAUSE_RESPONSE 20 // SAM response when NETLOGON is
paused
#define LOGON_SAM_USER_UNKNOWN 21 // SAM response when user is
unknown
#define LOGON_SAM_WKSTINFO_RESPONSE 22 // SAM response to
interrogate request
- Net Stop Netlogon
- Net Start Netlogon.
- This may start logging the Net Logon-related activity to
%windir%\debug\netlogon.log
Windows Server 2003, Windows XP Professional and Windows 2000 Server versions
The version of Netlogon.dll that has tracing included is installed by default. To enable debug logging, set the debug flag that you want in the registry and restart the service by using the following steps:
- Start the Regedt32 program.
- Delete the Reg_SZ value of the following registry entry, create a REG_DWORD value
with the same name, and then add the 2080FFFF hexadecimal value.
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Netlogon\Parameters\DBFlag
- At a command prompt, type net stop netlogon, and then type net start netlogon. This enables debug logging.
- To disable debug logging, change the data value to 0x0 in the following registry key:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Netlogon\Parameters\DBFlag
- Quit Regedt32.
- Stop Net Logon, and then restart Net Logon.
Note On Windows Server 2003-based computers, you can use the following Group Policy to configure the log file size:
\Computer Configuration\Administrative Templates\System\Net Logon\Maximum Log File Size
Note As an alternate method, you can set the dbflag without using the registry. To do this run the following command from a command prompt:
nltest /dbflag:0x2080ffffAfter you finish debugging, you can run the
nltest /dbflag:0x0 command from a command prompt to reset the debug flag to 0.
For more information, click the following article numbers to view the articles in the Microsoft Knowledge Base:
247811
How domain controllers are located in Windows
189541 Using the checked Netlogon.dll to track account lockouts
Note This is the public version of this article.
////////////////////////////////////////////////////////////////////////
// Windows 2000 and Windows 2003 Debug flags and their values.
////////////////////////////////////////////////////////////////////////
#define NL_INIT 0x00000001 // Initialization
#define NL_MISC 0x00000002 // Misc debug
#define NL_LOGON 0x00000004 // Logon processing
#define NL_SYNC 0x00000008 // Synchronization and replication
#define NL_MAILSLOT 0x00000010 // Mailslot messages
#define NL_SITE 0x00000020 // Sites
#define NL_CRITICAL 0x00000100 // Only real important errors
#define NL_SESSION_SETUP 0x00000200 // Trusted Domain maintenance
#define NL_DOMAIN 0x00000400 // Hosted Domain maintenance
#define NL_2 0x00000800
#define NL_SERVER_SESS 0x00001000 // Server session maintenance
#define NL_CHANGELOG 0x00002000 // Change Log references
#define NL_DNS 0x00004000 // DNS name registration
//
// Very verbose bits
//
#define NL_WORKER 0x00010000 // Debug worker thread
#define NL_DNS_MORE 0x00020000 // Verbose DNS name registration
#define NL_PULSE_MORE 0x00040000 // Verbose pulse processing
#define NL_SESSION_MORE 0x00080000 // Verbose session management
#define NL_REPL_TIME 0x00100000 // replication timing output
#define NL_REPL_OBJ_TIME 0x00200000 // replication objects get/set timing output
#define NL_ENCRYPT 0x00400000 // debug encrypt and decrypt across net
#define NL_SYNC_MORE 0x00800000 // additional replication dbgprint
#define NL_PACK_VERBOSE 0x01000000 // Verbose Pack/Unpack
#define NL_MAILSLOT_TEXT 0x02000000 // Verbose Mailslot messages
#define NL_CHALLENGE_RES 0x04000000 // challenge response debug
#define NL_SITE_MORE 0x08000000 // Verbose sites
//
// Control bits.
//
#define NL_INHIBIT_CANCEL 0x10000000 // Don't cancel API calls
#define NL_TIMESTAMP 0x20000000 // TimeStamp each output line
#define NL_ONECHANGE_REPL 0x40000000 // Only replicate one change per call
#define NL_BREAKPOINT 0x80000000 // Enter debugger on startup