How do I debug roaming profiles?

A. It is possible to create a log file of all roaming profile transactions using the checked version of userenv.dll. The checked version of the UserEnv.dll is the same dynamic link library (.dll) as the retail version, except that it contains debug flags that you can set and use with the kernel debugger. This file, which is included in both the Windows NT Device Driver Kit (DDK) and the Windows NT Software Development Kit (SDK)

  1. Rename the Userenv.dll file in the %systemroot%\System32 directory to
    C:\> rename %systemroot%\system32\userenv.dll
  2. Copy the checked version of Userenv.dll to the %systemroot%\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.
    C:\> copy userenv.chk %systemroot%\system32\userenv.dll
  3. Start the registry editor (regedit.exe)
  4. Move to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon
  5. From the Edit menu select New - DWORD value
  6. Enter a name of UserEnvDebugLevel and press ENTER
  7. Double click the new value, set the type to hexadecimal and set to 10002. Click OK
  8. Reboot the computer

A log file of the roaming profile transactions will be written to userenv.log to the root of the C: drive. Below is an profile log.


LoadUserProfile: Entering, hToken = <0xb0>, lpProfileInfo = 0x12f4e8
LoadUserProfile: lpProfileInfo->dwFlags = <0x2>
LoadUserProfile: lpProfileInfo->lpUserName = <savillj>
LoadUserProfile: lpProfileInfo->lpProfilePath = <\\titanic\Profiles\savillj>
LoadUserProfile: lpProfileInfo->lpDefaultPath = <\\TITANIC\netlogon\Default User>
LoadUserProfile: lpProfileInfo->lpServerName = <\\TITANIC>
LoadUserProfile: lpProfileInfo->lpPolicyPath = <\\TITANIC\netlogon\ntconfig.pol>
ParseProfilePath: Entering, lpProfilePath = <\\titanic\Profiles\savillj>
ParseProfilePath: Tick Count = 20
ParseProfilePath: FindFirstFile found something with attributes <0x10>
ParseProfilePath: Found a directory
LoadUserProfile: ParseProfilePath returned a directory of <\\titanic\Profiles\savillj>
RestoreUserProfile: Entering
RestoreUserProfile: Profile path = <\\titanic\Profiles\savillj>
RestoreUserProfile: User is a Admin
IsCentralProfileReachable: Entering
IsCentralProfileReachable: Testing <\\titanic\Profiles\savillj\>
IsCentralProfileReachable: Profile is not reachable, error = 2
IsCentralProfileReachable: Testing <\\titanic\Profiles\savillj\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\savillj>
GetLocalProfileImage: Expanded local profile image filename = <E:\WINNT\Profiles\savillj>
GetLocalProfileImage: No local mandatory profile. Error = 2
GetLocalProfileImage: Found local profile image file ok <E:\WINNT\Profiles\savillj\ntuser.dat>
Local profile is reachable
Local profile name is <E:\WINNT\Profiles\savillj>
RestoreUserProfile: About to call UpdateToLatestProfile
UpdateToLatestProfile: Entering. Central = <\\titanic\Profiles\savillj> Local = <E:\WINNT\Profiles\savillj>
UpdateToLatestProfile: Central and local profile times match.
RestoreUserProfile: About to Leave. Final Information follows:
Profile was successfully loaded.
lpProfile->szCentralProfile = <\\titanic\Profiles\savillj>
lpProfile->szLocalProfile = <E:\WINNT\Profiles\savillj>
lpProfile->dwInternalFlags = 0x112
RestoreUserProfile: Leaving.
UpgradeProfile: Entering
UpgradeProfile: Build numbers match
UpgradeProfile: Leaving Successfully
ApplyPolicy: Entering
ApplyPolicy: PolicyPath is: <\\TITANIC\netlogon\ntconfig.pol>.
ApplyPolicy: Local PolicyPath is: <E:\WINNT\Profiles\savillj\prf1.tmp>.
ApplyPolicy: Looking for user specific policy. OpenUserKey: No entry for savillj, using .Default instead.
CopyKeyValues: EnableProfileQuota => 1 <OK>
CopyKeyValues: ProfileQuotaMessage => You have exceeded your profile storage space. Before you can log off, you need to move some items from your profile to network or local storage. <OK>
CopyKeyValues: MaxProfileSize => 48 <OK>
CopyKeyValues: WarnUserTimeout => 15 <OK>
ApplyPolicy: Processing group(s) policy.
ApplyPolicy: Failed to get group processing order.
ApplyPolicy: Looking for machine specific policy.
OpenUserKey: No entry for ODIN, using .Default instead.
ApplyPolicy: Leaving with 1
LoadUserProfile: Leaving with a value of 1. hProfile = <0x90>


TAGS: Windows 8
Hide comments


  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.