Debugging User Profiles and System Policies in Windows NT 4.0

Last reviewed: February 17, 1998
Article ID: Q154120
The information in this article applies to:
  • Microsoft Windows NT Server version 4.0

IMPORTANT: This article contains information about editing the registry. Before you edit the registry, make sure you understand how to restore it if a problem occurs. For information on how to do this, view the "Restoring the Registry" online Help topic in Regedit.exe or the "Restoring a Registry Key" online Help topic in Regedt32.exe.

SUMMARY

The checked version of Userenv.dll, in conjunction with a registry entry, creates a log file useful in troubleshooting and debugging problems with roaming profiles and system policies on Microsoft Windows NT version 4.0 clients.

MORE INFORMATION

To enable the log file:

  1. Rename the Userenv.dll file in the %Windir%\System32 directory to Usernv.orig or the unique name of your choice.

  2. Copy the checked version of Userenv.dll to the %Windir%\System32 directory of the client computer that you want to debug. The checked version of the Userenv file must match the version of the operating system being used.

WARNING: Using Registry Editor incorrectly can cause serious problems that may require you to reinstall your operating system. Microsoft cannot guarantee that problems resulting from the incorrect use of Registry Editor can be solved. Use Registry Editor at your own risk.

For information about how to edit the registry, view the "Changing Keys And Values" online Help topic in Registry Editor (Regedit.exe) or the "Add and Delete Information in the Registry" and "Edit Registry Data" online Help topics in Regedt32.exe. Note that you should back up the registry before you edit it.

  1. Start Regdt32 and locate the following path:

          HKEY_LOCAL_MACHINE\Software\Microsoft\WindowsNT\CurrentVersion
          \Winlogon
    

    NOTE: The above registry key is one path; it has been wrapped for readability.

  2. Create a new value called UserEnvDebugLevel as a reg_dword. Assign the value 10002 in hexadecimal format.

  3. Restart the computer with the .dll and registry changes in place.

Log information will be recorded in the root directory of drive C as Userenv.log and can be viewed with Notepad, WordPad, or the text editor of your choice.

Information displayed in the log includes: profile path, profile type, system policy path (useful to determine which server the Ntconfig.pol file was pulled from), whether the profile was successfully loaded and unloaded at the client, and if the remote profile is newer than the local profile.

A sample Userenv.log based on the following information is shown below.

   Username = profile
   Profile path defined in User Manager =
      PDCServerName\Profiles\%username%
   Domain Controller = PDCServerName
   System Policy Path: PDCServerName\Netlogon

NOTE: The response to the seventeenth line

   Profile is not reachable, error = 2

is normal as a check is made for the existence of a mandatory profile path being defined in User Manager for Domains (Servername\Sharename\%Username%.man). Mandatory profiles were not used in this example, so the test fails.

LoadUserProfile: Entering, hToken = <0xa8>, lpProfileInfo = 0x12f4e8 LoadUserProfile: lpProfileInfo->dwFlags = <0x2> LoadUserProfile: lpProfileInfo->lpUserName = <profile> LoadUserProfile: lpProfileInfo->lpProfilePath = <\\PDCServerName\profiles\profile> LoadUserProfile: lpProfileInfo->lpDefaultPath = <\\PDCServerName\netlogon\Default User> LoadUserProfile: lpProfileInfo->lpServerName = <\\PDCServerName> LoadUserProfile: lpProfileInfo->lpPolicyPath = <\\PDCServerName\netlogon\ntconfig.pol> ParseProfilePath: Entering, lpProfilePath = <\\PDCServerName\profiles\profile> ParseProfilePath: Tick Count = 60 ParseProfilePath: FindFirstFile found something with attributes <0x10> ParseProfilePath: Found a directory LoadUserProfile: ParseProfilePath returned a directory of <\\PDCServerName\profiles\profile> RestoreUserProfile: Entering RestoreUserProfile: Profile path = <\\PDCServerName\profiles\profile> RestoreUserProfile: User is a Admin IsCentralProfileReachable: Entering IsCentralProfileReachable: Testing <\\PDCServerName\profiles\profile\ntuser.man> IsCentralProfileReachable: Profile is not reachable, error = 2 IsCentralProfileReachable: Testing <\\PDCServerName\profiles\profile\ntuser.dat> IsCentralProfileReachable: Found a user profile. RestoreUserProfile: Central Profile is reachable RestoreUserProfile: Central Profile is floating GetLocalProfileImage: Found entry in profile list for existing local profile GetLocalProfileImage: Local profile image filename = <%SystemRoot%\Profiles\profile> GetLocalProfileImage: Expanded local profile image filename = <C:\WINNT\Profiles\profile> GetLocalProfileImage: Found local profile image file ok <C:\WINNT\Profiles\profile\ntuser.dat> Local profile is reachable Local profile name is <C:\WINNT\Profiles\profile> RestoreUserProfile: About to call UpdateToLatestProfile UpdateToLatestProfile: Entering. Central = <\\PDCServerName\profiles\profile> Local = <C:\WINNT\Profiles\profile> UpdateToLatestProfile: Central and local profile times match. RestoreUserProfile: About to Leave. Final Information follows: Profile was successfully loaded. lpProfile->szCentralProfile = <\\PDCServerName\profiles\profile> lpProfile->szLocalProfile = <C:\WINNT\Profiles\profile> lpProfile->dwInternalFlags = 0x112 RestoreUserProfile: Leaving. UpgradeProfile: Entering UpgradeProfile: Build numbers match UpgradeProfile: Leaving Successfully ApplyPolicy: Entering ApplyPolicy: PolicyPath is: <\\PDCServerName\netlogon\ntconfig.pol>. ReconcileFile: \\PDCServerName\netlogon\ntconfig.pol ==> C:\WINNT\Profiles\Policy\ntconfig.pol [OK] ApplyPolicy: Local PolicyPath is: <C:\WINNT\Profiles\Policy\ntconfig.pol>. ApplyPolicy: Leaving succesfully. LoadUserProfile: Leaving with a value of 1. hProfile = <0x90>

Below is a successful logoff and update by the client of the server- based roaming profile.

UnloadUserProfile: Entering, hProfile = <0xe0> UnloadUserProfile: Succesfully unloaded profile UnloadUserProfile: Copying profile back to \\PDCServerName\profiles\profile CopyProfileDirectory: Entering, lpSourceDir = <C:\WINNT\Profiles\profile>, lpDestinationDir = <\\PDCServerName\profiles\profile>, dwFlags = 0x32 ReconcileFile: C:\WINNT\Profiles\profile\NTUSER.DAT ==> \\PDCServerName\profiles\profile\NTUSER.DAT [OK] ReconcileFile: C:\WINNT\Profiles\profile\ntuser.dat.LOG ==> \\PDCServerName\profiles\profile\ntuser.dat.LOG [OK] CopyProfileDirectory: Leaving with a return value of 1 UnloadUserProfile: Leaving with a return value of 1

Keywords          : nthowto NTSrv
Version           : WinNT:4.0
Platform          : winnt
Issue type        : kbhowto


================================================================================


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: February 17, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.