The Deployment Guys

Helping to deploy your world automagically...

USMT Failures Due To Bad Profile List Entries

USMT Failures Due To Bad Profile List Entries

  • Comments 15
  • Likes

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.

Attachment: MDTValidateUserProfileFolders_v1.0.2.zip
  • <p>Can the error code in the scanlogs during scanstate reference an error that occurs during the migunits phase of usmt? Usually I experience this with an error code of 10 with level 7 verbosity.</p>

  • <p> I appreciate the publication of this code. </p> <p>However, i ran into ONE situation where i had a &nbsp;PROFILELIST Registry key but it had NO SUB-KEYS? It was a Key ending in &quot;500&quot; but empty, on a Windows 7 32-bit image?? I updated the code to perform a &quot;ISNULL&quot; on the ProfileImagePath ELSE the code will abort when</p> <p>it tries to verify the existance of a 'null' </p> <p>path. You may want to add the check also, for others.. Again, thanks for the code.. J P Morgan - j.p.morgan@lmco.com</p>

  • <p>Michael, </p> <p>I hate to bother you again, BUT i am getting a failure using the latest MDTValidateUserProfileFolders.ZIP.</p> <p>The script is FAILING on Windows 7 X64. When it checks for the &quot;NTUSER.DAT&quot; (new code check you added) it</p> <p>says that the file DOES NOT EXIST..?? It is only doing it for the config\SYSTEMPROFILE. The &#39;NTUSER.DAT&quot; DOES EXIST !!</p> <p>however it displays in lowercase &quot;ntuser.dat&quot;. The oFSO.FileExists checks for a file &quot;NTUSER.DAT: (in uppercase).</p> <p>When i change to use &#39;ntuser.dat&quot; (in lower case) it DOES FIND the FILE?? </p> <p>Is it a Posix issues , i thought systems stored file name in BOTh upper and lower case. </p> <p>Anyway, you may know EXACT reason why it fails when the NTUSER.DAT file is lowercase??</p> <p>Let me know if you do.</p> <p>Thanks.</p> <p>J P Morgan - j.p.morgan@lmco.com james_p_morgan@hotmail.com</p>

  • <p>Michael, </p> <p>I hate to bother you again, BUT i am getting a failure using the latest MDTValidateUserProfileFolders.ZIP.</p> <p>The script is FAILING on Windows 7 X64. When it checks for the &quot;NTUSER.DAT&quot; (new code check you added) it</p> <p>says that the file DOES NOT EXIST..?? It is only doing it for the config\SYSTEMPROFILE. The &#39;NTUSER.DAT&quot; DOES EXIST !!</p> <p>however it displays in lowercase &quot;ntuser.dat&quot;. The oFSO.FileExists checks for a file &quot;NTUSER.DAT: (in uppercase).</p> <p>When i change to use &#39;ntuser.dat&quot; (in lower case) it DOES FIND the FILE?? </p> <p>Is it a Posix issues , i thought systems stored file name in BOTh upper and lower case. </p> <p>Anyway, you may know EXACT reason why it fails when the NTUSER.DAT file is lowercase??</p> <p>Let me know if you do.</p> <p>Thanks.</p> <p>J P Morgan - j.p.morgan@lmco.com james_p_morgan@hotmail.com</p>

  • <p>Michael,</p> <p>Looks like i was WRONG about the &#39;lower-case&#39; &quot;NTUSER.DAT&#39; causing the problem.</p> <p>The WSF &#39;errors-out&#39; on finding &nbsp;the SYSTEMPROFILE NRUSER.DAT &nbsp;WHEN i execute it from</p> <p>a compiled AUTOIT script. When i ran manually from a command prompt or automated from</p> <p>a command prompt windows it DOES NOT &#39;THROW&quot; the error about NTUSER.DAT &#39;missing&#39;.</p> <p>I am at a loss at this time.. as to why it ONLY does it on Windows 7 X64 when</p> <p>executed in a comannd prompt that was spawned from a Compield AutoIT script.</p> <p>I am running using the Local; Administrator account, with UAC &#39;turned-off&#39;??</p> <p>Sorry to bother you.</p> <p>J P Morgan</p>

  • <p>Michael,</p> <p>Further investigation shows that it DOES NOT give me the error with the SYSTEMPROFILE on another Windows 7 X64</p> <p>system. The other ystem is Joined to a doamin, where as MY original system is in a workgroup. I tried both systems</p> <p>with UAC disabled and they work the &#39;same&#39; as with UAC enabled.</p> <p>, </p> <p>It MAY be &#39;something&#39; about my system config, i have ALOT of things installed, including some Virtual App</p> <p>clients..</p> <p>Sorry to raise an issue when there may not be one.. i will perform further analysis and let you know what i find.</p> <p>Thanks.. J P Morgan</p>

  • <p>Michael,</p> <p>Seems that i MAY have identified and resolved the AutoIT issues when running your MDTValidateUserProfileFolders.wsf </p> <p>script from a Compiled AutoIt script. I had to create TWO compiled Autoit script, one for x86 and one for x64 compiled</p> <p>platforms. When i selected &#39;compile for x64 platform&#39; option, the resulting Autoit compiled acript that is &#39;wrapper&#39;</p> <p>for your scripts, was SUCCESSFULLY able to &#39;find&#39; the NTUSER.DAT in the SYSTEMPROFILE folder.</p> <p>Hope this helps.</p> <p>J P Morgan</p>

  • <p>I&#39;m using this to troubleshooting usmt issues I&#39;m having with MDT 2010 and it is returning an error: Profile &#39;C:\winnt\system32\config\systemprofile&#39; does not contain a user registry hive file (NTUSER.DAT)</p> <p>Notes: &nbsp;Our Windows directory is named WINNT</p> <p>Our profiles are on D:\Profiles</p> <p>For reasons I cringe even thinking about, but that is where I am. &nbsp;I&#39;m not sure where to go next. &nbsp;There really is no NTUSER.DAT in that systemprofile directory.</p>

  • <p>Hi folks, Ned here again. Occasionally, someone pings me to explain why USMT 4.0 scanstate is running slowly. My first demand is to see the scanstate.log file, having provided the argument /v:5 . That log shows the command-line, the XML files selected, and what &quot;slow&quot; really means. In this particular example the cause is like Soylent Green: it&#39;s peeeeoplllllle!!! The Scenario and Symptoms Scanstate is stuck for a long time at &quot;starting the migration process&quot; on a production computer. Often for many minutes, even though a test computer goes through that same phase in a few seconds. The Examination and Gathering phases are as quick as a test computer. There are no errors in the console and the migration eventually completes. The scanstate.log shows many entries like: Waiting 6000 msec to retry hive load (tries remaining: 17 )... IndirectKeyMapper: RegLoadKey(HKEY_USERS,S-1-5-21-2007108519-768573118-610138143-1118, C:\Documents and Settings\bshirley\NTUSER.DAT) failed (3) Dumping hive list at HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\hivelist... [\REGISTRY\MACHINE\HARDWARE] =&gt; [\REGISTRY\MACHINE\SECURITY] =&gt; \Device\HarddiskVolume1\WINDOWS\system32\config\SECURITY [\REGISTRY\MACHINE\SOFTWARE] =&gt; \Device\HarddiskVolume1\WINDOWS\system32\config\software [\REGISTRY\MACHINE\SYSTEM] =&gt; \Device\HarddiskVolume1\WINDOWS\system32\config\system [\REGISTRY\USER\.DEFAULT] =&gt; \Device\HarddiskVolume1\WINDOWS\system32\config\default [\REGISTRY\MACHINE\SAM] =&gt; \Device\HarddiskVolume1\WINDOWS\system32\config\SAM [\REGISTRY\USER\S-1-5-20] =&gt; \Device\HarddiskVolume1\Documents and Settings\NetworkService\NTUSER.DAT [\REGISTRY\USER\S-1-5-20_Classes] =&gt; \Device\HarddiskVolume1\Documents and Settings\NetworkService\Local Settings\Application Data\Microsoft\Windo [\REGISTRY\USER\S-1-5-19] =&gt; \Device\HarddiskVolume1\Documents and Settings\LocalService\NTUSER.DAT [\REGISTRY\USER\S-1-5-19_Classes] =&gt; \Device\HarddiskVolume1\Documents and Settings\LocalService\Local Settings\Application Data\Microsoft\Windows [\REGISTRY\USER\S-1-5-21-2007108519-768573118-610138143-500] =&gt; \Device\HarddiskVolume1\Documents and Settings\Administrator.CONTOSO\NTUSER.DAT [\REGISTRY\USER\S-1-5-21-2007108519-768573118-610138143-500_Classes] =&gt; \Device\HarddiskVolume1\Documents and Settings\Administrator.CONTOSO\Local End of hive list Waiting 6000 msec to retry hive load (tries remaining: 16 )... IndirectKeyMapper: RegLoadKey(HKEY_USERS,S-1-5-21-2007108519-768573118-610138143-1118, C:\Documents and Settings\bshirley\NTUSER.DAT) failed (3) Looking closer, you see 20 of these entries repeated for one or more user profiles. Cancelling processing with CTRL+C takes just as long as waiting for the pause to end naturally. You have to kill the scanstate.exe process manually if you want it to stop sooner. What is the data telling us? I’ll start Windows Explorer and regedit.exe , and then look at the user profile folder and the registry ProfileList key: If XP &#160; --&gt; C:\Documents and Settings If Vista/Win7 –&gt; C:\Users HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList See the issue? My file system looks like this: But my registry looks like this: Notice how there are six user SIDs in the ProfileList key, but only three user profiles on the file system. It is supposed to look like this: Where are Brett Shirley and the others? I&#39;ll tell you where: in the bit bucket, because somebody thinks that deleting a folder on the file system is the same as deleting profiles. It&#39;s not. That error we kept seeing the log is: C:\&gt;net helpmsg 3 The system cannot find the path specified. Why does USMT keep looking? USMT 4.0 tries to enumerate each profile 20 times, waiting 6 seconds a try, before giving up and moving to the next profile. This design handled a particular third party product that temporarily locked and renamed ntuser.dat files - a user&#39;s &quot;HKEY_CURRENT_USER&quot; registr

  • <p>could someone please help me how to set it up thru sccm 2007 task sequence so it will ignore or skip bad profiles in registery so we don&#39;t have to wait for it to retry 20 times with 6000 msec each time? &nbsp;we don&#39;t want to do it manually to check registery before we do OS deployment for each workstation.</p> <p>thanks in advance.</p>

  • <p>karennt,</p> <p>Please take a look at these:</p> <p><a rel="nofollow" target="_new" href="http://blogs.technet.com/b/askds/archive/2011/04/14/usmt-pauses-at-quot-starting-the-migration-process-quot-for-many-minutes-then-works.aspx">blogs.technet.com/.../usmt-pauses-at-quot-starting-the-migration-process-quot-for-many-minutes-then-works.aspx</a></p> <p><a rel="nofollow" target="_new" href="http://blogs.technet.com/b/deploymentguys/archive/2011/08/03/setting-environment-variables-in-a-task-sequence.aspx">blogs.technet.com/.../setting-environment-variables-in-a-task-sequence.aspx</a></p> <p>Michael Murgolo</p>

  • <p>Had an issue with the system profile as well so I modified the script to skip this profile. Here is the relevant section</p> <p>If instr(1, subfolder.Path, &quot;SystemProfile&quot;, 1) &gt; 0 then</p> <p> oLogging.CreateEntry &quot;Skipping System Profile&quot;, LogTypeInfo</p> <p>Else </p> <p> If Not oFSO.FolderExists(sProfileImagePath) Then</p> <p> &nbsp; &nbsp; &nbsp; &nbsp; oLogging.CreateEntry &quot; &nbsp;!!Error: Defined profile folder &quot;&quot;&quot; &amp; sProfileImagePath &amp; &quot;&quot;&quot; does not exist.&quot;, LogTypeError</p> <p> &nbsp; &nbsp; &nbsp; &nbsp;ZTIProcess = Failure</p> <p> Else</p> <p> &nbsp; &nbsp; &nbsp; &nbsp; oLogging.CreateEntry &quot; &nbsp;--Defined profile folder &quot;&quot;&quot; &amp; sProfileImagePath &amp; &quot;&quot;&quot; exists.&quot;, LogTypeInfo</p> <p> If Not oFSO.FileExists(sProfileImagePath &amp; &quot;\NTUSER.DAT&quot;) Then</p> <p> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oLogging.CreateEntry &quot; &nbsp;!!Error: Profile &#39;&quot; &amp; sProfileImagePath &amp; &quot;&#39; does not contain a user registry hive file (NTUSER.DAT)&quot;, LogTypeError</p> <p> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ZTIProcess = Failure</p> <p> End If</p> <p> End IF</p> <p>End If &nbsp; &nbsp;</p>

  • <p>Sorry, my bad...just been checking the results and its actually now skipping all profiles, instr line should actually read as follows:</p> <p>If instr(1, sProfileImagePath, &quot;SystemProfile&quot;, 1) &gt; 0 then</p>

  • <p>What can you do if there are two SIDs (during a domain migration) that point to the same profile path? USMT always bombs and I beleive it&#39;s because of these duplicate entries with different SIDs. We have been deleting the secondary SID (since we are imaging the machine anyway) but are being asked by the vendor who is performing the migration not to delete this second SID out of the user profile list. Is there a way to exclude profiles based on SIDs? Do you have any thoughts as to any work arounds?</p>

  • <p>@WBrady1965 - Check out this TN entry: <a rel="nofollow" target="_new" href="http://blogs.technet.com/b/askds/archive/2011/05/02/usmt-and-invalid-user-mapping.aspx">blogs.technet.com/.../usmt-and-invalid-user-mapping.aspx</a>. &nbsp;This isn&#39;t a straight-forward explanation, but you are correct - the multiple entries are the cause of USMT bailing. &nbsp;</p> <p>If you are performing a Windows 7 deployment in the middle of a cross-forest active directory migration, you may have some logistical challenges on your hands. &nbsp;The vendor likely wants both SID entries present, until they have completed the user migration - and have all users logging in with their new domain credentials. &nbsp;Until that is done, you may require *both* entries on he machine. If the migration is being done via QMM - you can use VMOVER.EXE in cleanup mode (Cleanup=Yes, and Profiles=Yes) in the VMOVER.INI file to remove the legacy domain SID&#39;s from the ProfileList key for you.</p> <p>Otherwise - reference that URL I mentioned above, as it does explain how USMT can be used to capture profiles for a specific domain sid, and ignore all others. That may be the more elegant approach, if the AD Migration is not yet completed.</p>

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment