USMT Failures Due To Bad Profile List Entries

Update 2010-05-07: Based on the feedback from James below (thanks James!) and similar feedback from a Microsoft Support Engineer (thanks Frank!) who hit the same failure due to Registry corruption, I’ve updated the attached script so it does not fail in these cases.

Update 2013-09-23:  I've attached a new version of the script that ignores "special" profiles like System and checks for temporary profiles.

One of the main goals of the User State Migration Tool is to capture and restore data in user profiles.  There are some conditions related to user profiles that may cause the tool to exit with an error.  One of these is bad ProfileList entries.

Windows stores the registered user profiles on the machine in the Registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList.  The subkeys of this key, which are named after the user account SID, hold the user profile information.  The physical location on disk for each user profile is stored in the ProfileImagePath entry in each subkey.  If this entry in any profile subkey is pointing to a location that does not exist, USMT will fail.  The most common cause of this condition is deleting the user profile folder manually using Windows Explorer instead of using the User Profiles user interface (System Control Panel, Advanced tab).  Unfortunately, the USMT logs do not make it obvious that this is what caused the failure.

Since this condition is hard to diagnose from the logs, I created an MDT script (MDTValidateUserProfileFolders.wsf) that will examine all the ProfileList entries and check to see if the ProfileImagePath folder exists.  It will also check to see if there are any unregistered folders in the profile storage folder (usually C:\Documents and Setting on XP/2003 and C:\Users on Vista and higher).  This condition can also lead to USMT failures.  If any profile folders are missing or there are extra folders in the profile storage folder, the script will exit with a return code of 1.

This will allow you to validate these conditions and take action (fail the task sequence, take other steps, etc.) if the undesired state exists.  It could also be deployed in a package before the OS migration to see which machines have the issue, so a technician could remedy the situation ahead of time.

MDTValidateUserProfileFolders.wsf (included in the attached Zip file) requires that the function library scripts MDTLibSpecialFolders.vbs (also included in the attached Zip file) and ZTIUtility.vbs (included with MDT) be in the same folder.  If you are using this with MDT, you can simply copy MDTValidateUserProfileFolders.wsf and MDTLibSpecialFolders.vbs to the MDT Scripts folder.  You would then use it in a Run Command Line step in the Task Sequence with the command line of:

cscript.exe "%ScriptRoot%\MDTValidateUserProfileFolders.wsf"

Disclaimer: The information on this site is provided "AS IS" with no warranties, confers no rights, and is not supported by the authors or Microsoft Corporation. Use of included script samples are subject to the terms specified in the Terms of Use .

This post was contributed by Michael Murgolo, a Senior Consultant with Microsoft Services - U.S. East Region.

MDTValidateUserProfileFolders_v1.0.2.zip