How do I debug roaming profiles?

John Savill

March 4, 1999

3 Min Read
ITPro Today logo in a gray background | ITPro Today

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 Usernv.org.
    C:> rename %systemroot%system32userenv.dll userenv.org

  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%system32userenv.dll

  3. Start the registry editor (regedit.exe)

  4. Move to HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindows NTCurrentVersionWinlogon

  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 =
LoadUserProfile: lpProfileInfo->lpProfilePath = <\titanicProfilessavillj>
LoadUserProfile: lpProfileInfo->lpDefaultPath = <\TITANICetlogonDefault User>
LoadUserProfile: lpProfileInfo->lpServerName = <\TITANIC>
LoadUserProfile: lpProfileInfo->lpPolicyPath = <\TITANICetlogontconfig.pol>
ParseProfilePath: Entering, lpProfilePath = <\titanicProfilessavillj>
ParseProfilePath: Tick Count = 20
ParseProfilePath: FindFirstFile found something with attributes <0x10>
ParseProfilePath: Found a directory
LoadUserProfile: ParseProfilePath returned a directory of <\titanicProfilessavillj>
RestoreUserProfile: Entering
RestoreUserProfile: Profile path = <\titanicProfilessavillj>
RestoreUserProfile: User is a Admin
IsCentralProfileReachable: Entering
IsCentralProfileReachable: Testing <\titanicProfilessavilljtuser.man>
IsCentralProfileReachable: Profile is not reachable, error = 2
IsCentralProfileReachable: Testing <\titanicProfilessavilljtuser.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%Profilessavillj>
GetLocalProfileImage: Expanded local profile image filename =
GetLocalProfileImage: No local mandatory profile. Error = 2
GetLocalProfileImage: Found local profile image file ok
Local profile is reachable
Local profile name is
RestoreUserProfile: About to call UpdateToLatestProfile
UpdateToLatestProfile: Entering. Central = <\titanicProfilessavillj> Local =
UpdateToLatestProfile: Central and local profile times match.
RestoreUserProfile: About to Leave. Final Information follows:
Profile was successfully loaded.
lpProfile->szCentralProfile = <\titanicProfilessavillj>
lpProfile->szLocalProfile =
lpProfile->dwInternalFlags = 0x112
RestoreUserProfile: Leaving.
UpgradeProfile: Entering
UpgradeProfile: Build numbers match
UpgradeProfile: Leaving Successfully
ApplyPolicy: Entering
ApplyPolicy: PolicyPath is: <\TITANICetlogontconfig.pol>.
ApplyPolicy: Local PolicyPath is: .
ApplyPolicy: Looking for user specific policy. OpenUserKey: No entry for savillj, using .Default instead.
CopyKeyValues: EnableProfileQuota => 1
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.
CopyKeyValues: MaxProfileSize => 48
CopyKeyValues: WarnUserTimeout => 15
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>

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

About the Author

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like