none
Performing a USMT migration in offline mode under Windows PE (My Solution) RRS feed

  • General discussion

  • UPDATE - 3/24/2011: Added architecture checking (so no need for separate x86 & x64 task sequences), the ability to scan a range of drive letters (C-G) for a Windows system partition to migrate and an Offline.xml file to specify additional drive letters to migrate. See below for details and please check my code for errors!

    The question "How do I use MDT to perform an offline USMT migration under Windows PE" seems to be a recurring one around here. I know it’s something I have personally struggled with. To my knowledge no real solution to this conundrum has been posted on this forum (yet). Instead of sitting around and moping about it I decided to make my own. After a lot of research, trial and error I was able to create a standalone custom task sequence that will perform offline USMT migrated under Windows PE. To give credit where credit is due I do want to point out that I used the following SCCM-specific guides as starting points:

    http://www.windows-noob.com/forums/index.php?/topic/1735-using-offline-mode-in-windows-pe-using-usmt-4-via-a-task-sequence-in-sccm-2007-sp2/

    However I think you’ll see my solution has morphed into its own entity almost entirely. The task sequence itself simply does a USMT capture in offline mode and almost all the settings are controlled using the standard USMT-related variables in CS.ini. It does not deploy an OS or run Loadstate to restore (as I perform those tasks separately). Also I did it this way on purpose to keep it simple (KISS right?). Feel free to add, modify or suggest changes to it as needed (comments by more knowledgeable people are very welcome). Obviously I offer this with no warranties or guarantees. It may not be the BEST solution but it was the best I could come up with. If anyone can improve upon it please feel free to post those improvements here so we can all learn something. To my knowledge the only real dependencies it has is that the offline drive you are migrating has to be assigned a drive letter in the range "C-G" (the task sequence will search these drives in alphabetical order for a "Windows" directory and start migrating the first one it finds). Also an "Offline.xml" specifying your drive letter range needs to be included in your USMT x64 & x86 folders (covered further down) at %DeployRoot%.

    CS.ini variables required by the task sequence:
    (I have a few values I'm using listed but obviously you could customize these to whatever you want).
    UDShare=\\<MyServer>\<MyShare>$
    UDDir=%OSDComputerName%
    ScanStateArgs=<MyScanStateArgs>
    USMTMigFiles001=MigApp.xml
    USMTMigFiles002=MigUser.xml
    USMTMigFiles003=MigCustomData.xml
    USMTConfigFile=MigCustomConfig.xml

    Offline.xml and offlineWinDir:
    Part of running USMT in offline mode involves specifying the path to the Windows directory of the drive you wish to migrate. There are 2 methods:
     
    /offline: <path to offline.xml>:
    This command-line option enables the offline-migration mode and requires a path to an Offline.xml configuration file.
     
    /offlineWinDir: <Windows directory>:
    This command-line option enables the offline-migration mode and starts the migration from the location specified. It is only for use in Windows PE offline scenarios where the migration is occurring from a Windows directory.
    More information on this subject can be found here:
     
     
    Of these methods I prefer using an offline.xml file to detect the Windows dir in my drive range (C-G) as it seems to offer the greatest level of flexibility. If you want to use /offlineWinDir just edit the part of the task sequnece that references offline.xml to reference your desired /offlineWinDir location instead it and make sure you aslo disable offline.xml.
     
    The USMT Offline.xml file:
    (Copy and paste the following into your own offline.xml and save copies to both the x86 and x64 folders in your USMT folder at %DeployRoot%).

    --------------------------------------------------------------------------
     
    <!-- Scan a range of drive letters for a Windows partition to migrate in offline mode. -->
    <offline>
     <winDir>
     <path>C:\Windows</path>
     <path>D:\Windows</path>
     <path>E:\Windows</path>
     <path>F:\Windows</path>
     <path>G:\Windows</path>
     </winDir>
     <failOnMultipleWinDir>1</failOnMultipleWinDir>
    </offline>
    

    --------------------------------------------------------------------------

    NOTE: The Task Sequence code is posted further below, scroll down to see it.

    • Edited by ZeusABJ Thursday, March 24, 2011 5:04 PM
    Saturday, March 19, 2011 4:20 AM

All replies

  • Thank you very much for doing this.  I will definitely try this out.
    Saturday, March 19, 2011 1:50 PM
  • I'm not a deployment guru or anything, but couldn't you just use the existing %architecture% variable that should get set from the "Gather" step?  If so then you could just create one Task Sequence that would handle both architectures.  It would change depending on whether you used an x64 boot image or an x86 boot image I believe.

    Did you find it necessary to reset that variable when you tested this in order to make it work?

    Saturday, March 19, 2011 2:10 PM
  • I'm not a deployment guru or anything, but couldn't you just use the existing %architecture% variable that should get set from the "Gather" step?  If so then you could just create one Task Sequence that would handle both architectures.  It would change depending on whether you used an x64 boot image or an x86 boot image I believe.

    Did you find it necessary to reset that variable when you tested this in order to make it work?

    Its needed for two reasons:.

    1. The architecture folders containing the USMT scripts and files are named "x64" and "x86". The %architecture% variable returns "x86" when it detects a 32-bit processor (as you would expect) but instead of "x64" it actually returns the value "amd64" for 64-Bit processors. So the value that would get passed for the 64-bit USMT folder name would be "amd64" which would be incorrect.
    2. There is another problem with doing it the way you suggest. When you are operating under Windows PE the value that gets set for %architecture% will actually represent the architecture of Windows PE (not the computer you are migrating). So say you used Windows PE x86 to migrate an offline x64 Windows client (or vice versa). The migration would fail because the version of USMT it would select to use would be the wrong architecture for the drive you are trying to migrate.

    So basically the task sequence is overriding some default environment variables (%SystemDrive%, %architecture%, etc) to direct the USMT to the offline drive instead of Windows PE. Make sense? This is something I'd like to work better (to have just one task sequence that is smart enough to work with both). If anyone has a better way by all means post it... 

    Saturday, March 19, 2011 5:31 PM
  • Yeah I knew about number 2 (which I mentioned).  

    This way of doing it provides no way to inspect the target OS to be migrated from so it's up to you to pick the right task sequence.  At some point you have to make a decision...either which task sequence to use or which boot image to use.  If you picked the wrong task sequence yours would fail too.  I think my preference would be to just pick the right boot image to start...for a few reasons.

    For me the whole reason I want offline USMT migrations is because I likely have an OS that won't boot and maybe I just need to reimage that machine (start a refresh offline basically).  If that's the case then you could create another task sequence that not only captures user state offline, but also you could add on to the task sequence you created to have it also deploy an OS and grab the user state you migrated when you started and reapply it to the new image.  This would require you be in the right version of PE anyhow since you can't deploy x64 windows from an x86 PE environment.

    I also feel like you shouldn't touch the task sequence variables that other built-in tasks may rely on to work.  If you change them then you couldn't add more steps like I mention above even if you wanted to.  It makes the task sequence you wrote less dynamic.  If you wanted to handle it in one task sequence you could do something like this maybe and use %USMTarchicturer% instead of changing %architecture%.  This same task sequence would be usable whether you booted in to x86 PE or x64 PE.

    You would still have to address changing %SystemDrive% if it bothers you like it does me.  Also would have to update your scanstate arguments to use the new variables.

    That's probably how I will do it for now, but as you said there is probably a better way than mine also.

      <group expand="true" name="State Capture (Offline)" description="" disable="false" continueOnError="false">
        <action />
        <step type="SMS_TaskSequence_SetVariableAction" name="Set USMTarchitecture (x86)" description="Set the OS architecture of the offline Windows partition you wish to migrate." disable="false" continueOnError="false" successCodeList="0 3010">
          <defaultVarList>
            <variable name="VariableName" property="VariableName">USMTArchitecture</variable>
            <variable name="VariableValue" property="VariableValue">x86</variable>
          </defaultVarList>
          <action>cscript.exe "%SCRIPTROOT%\ZTISetVariable.wsf"</action>
          <condition>
            <expression type="SMS_TaskSequence_VariableConditionExpression">
              <variable name="Variable">architecture</variable>
              <variable name="Operator">equals</variable>
              <variable name="Value">x86</variable>
            </expression>
          </condition>
        </step>
        <step type="SMS_TaskSequence_SetVariableAction" name="Set USMTarchitecture (x64)" description="" disable="false" continueOnError="false" successCodeList="0 3010">
          <defaultVarList>
            <variable name="VariableName" property="VariableName">USMTarchitecture</variable>
            <variable name="VariableValue" property="VariableValue">x64</variable>
          </defaultVarList>
          <action>cscript.exe "%SCRIPTROOT%\ZTISetVariable.wsf"</action>
          <condition>
            <expression type="SMS_TaskSequence_VariableConditionExpression">
              <variable name="Variable">architecture</variable>
              <variable name="Operator">equals</variable>
              <variable name="Value">AMD64</variable>
            </expression>
          </condition>
        </step>

    Tuesday, March 22, 2011 2:04 PM
  • One problem I see with this is if you want to add steps to change from Windows XP (x86) to Windows 7 (x64) after the usmt capture you would have to boot in to x86 PE to do the capture and then reboot in to x64 PE to do the new deployment.  With this in mind I already know there is more tweaking needed to make it even more dynamic.  I'll have to think it over.

    Tuesday, March 22, 2011 2:57 PM
  • As I'm reading your description on your set architecture variable I realize you are missing something.  You have the following description: "Set the OS architecture of the offline Windows partition you wish to migrate."  This actually isn't what you're doing.  You're actually selecting which architecture of USMT to use which should be basd on what architecture of PE you're in and not the arch of the Windows install to be migrated.  The architecture of the offline Windows install should be set using something like this or you could run in to errors.  See my post that follows for more info.


        <step type="SMS_TaskSequence_SetVariableAction" name="Set offline Win arch if x64" description="determines if architecture of offline WinDir is x64" disable="false" continueOnError="false" successCodeList="0 3010">
          <defaultVarList>
            <variable name="VariableName" property="VariableName">MIG_OFFLINE_PLATFORM_ARCH</variable>
            <variable name="VariableValue" property="VariableValue">x64</variable>
          </defaultVarList>
          <action>cscript.exe "%SCRIPTROOT%\ZTISetVariable.wsf"</action>
          <condition>
            <operator type="and" />
            <expression type="SMS_TaskSequence_FolderConditionExpression">
              <variable name="Path">C:\Program Files (x86)</variable>
            </expression>
          </condition>
        </step>
        <step type="SMS_TaskSequence_SetVariableAction" name="Set offline Win arch if x86" description="determines if architecture of offline WinDir is x86" disable="false" continueOnError="false" successCodeList="0 3010">
          <defaultVarList>
            <variable name="VariableName" property="VariableName">MIG_OFFLINE_PLATFORM_ARCH</variable>
            <variable name="VariableValue" property="VariableValue">x86</variable>
          </defaultVarList>
          <action>cscript.exe "%SCRIPTROOT%\ZTISetVariable.wsf"</action>
          <condition>
            <operator type="not" />
            <expression type="SMS_TaskSequence_FolderConditionExpression">
              <variable name="Path">C:\Program Files (x86)</variable>
            </expression>
          </condition>
        </step>

    Tuesday, March 22, 2011 3:36 PM
  • Error: “The subsystem needed to support the image type is not present”

    This error is caused by running a 32-bit version of USMT within a 64-bit WinPE image. There are two rather obvious solutions to this:

    1. Use an x86 version of WinPE when running an x86 version of USMT.

    2. Use an x64 version of WinPE when running an X64 version of USMT.

    It’s fine to use x64 WinPE and USMT to run a scanstate on an x86 offline OS. Always remember to specify the environment variable for the offline OS architecture being scanned. This variable is:

    MIG_OFFLINE_PLATFORM_ARCH=<86 or 64>

    For example, if the offline OS being scanned was 32-bit Windows XP, you would specify the following in the WinPE command prompt that is about to run scanstate:

    SET MIG_OFFLINE_PLATFORM_ARCH=86

    ------credit to http://blogs.technet.com/b/askds/archive/2010/02/18/usmt-4-and-winpe-common-issues.aspx------

    As you can see if you don't specify this variable then you could have problems when you pick your task sequence that migrates an x64 install when you're in an x86 PE environment or vice versa.  So your way of picking task sequence based on the version of Windows to be migrated won't always work the way you currently have it coded.

    Tuesday, March 22, 2011 3:45 PM
  • Yeah I knew about number 2 (which I mentioned).

    Sorry if I came across as patronizing. You did point that out and I missed it.

    This way of doing it provides no way to inspect the target OS to be migrated from so it's up to you to pick the right task sequence.  At some point you have to make a decision...either which task sequence to use or which boot image to use.  If you picked the wrong task sequence yours would fail too.  I think my preference would be to just pick the right boot image to start...for a few reasons.

    Very good point, like I said I was not pleased with this approach, it was just the best I could come up with at the time. I was hoping that posting my solution here would generate discussion and improvements could be made. As i said I'm a functional scriptor at best, but this notion of an "offline USMT Migration" kept coming up so SOMEBODY had to take acton and try to build it right? So I gave it the old college try! ;)

    For me the whole reason I want offline USMT migrations is because I likely have an OS that won't boot and maybe I just need to reimage that machine (start a refresh offline basically).  If that's the case then you could create another task sequence that not only captures user state offline, but also you could add on to the task sequence you created to have it also deploy an OS and grab the user state you migrated when you started and reapply it to the new image.  This would require you be in the right version of PE anyhow since you can't deploy x64 windows from an x86 PE environment.

    This si the same exact challenge I face so I'm glad to know we are in the same boat. Hopefully between the two of us we can perfect a solution. As for the 2nd task sequence to apply the image and restore the user state, thats also why I kept this simple and focus only on the scanstate piece. The goal was to perfect that piece in task sequence form and then we could use it as a starting point to build out more complex task sequences. 

    I also feel like you shouldn't touch the task sequence variables that other built-in tasks may rely on to work.  If you change them then you couldn't add more steps like I mention above even if you wanted to.  It makes the task sequence you wrote less dynamic.  If you wanted to handle it in one task sequence you could do something like this maybe and use %USMTarchicturer% instead of changing %architecture%.  This same task sequence would be usable whether you booted in to x86 PE or x64 PE.

    You would still have to address changing %SystemDrive% if it bothers you like it does me.  Also would have to update your scanstate arguments to use the new variables.

    I'm actually leaning more towards your line of thought here as well. As I mentioned above I used these guides as a startign point:

    My main goal was to just get it WORKING at first then I could streamline it later. This task sequence was the first attempt I made that WORKED. I staretd out using the Windows Noob guide first and found Peter Van Der Woude's guide towards the end of creating the task sequence. If you check out Peter's guide you'll notice he altered many of the variables to be more unique (as you suggested) like using %WindowsPartion% instead of %SystemDrive%. Interestingly enough he stuck with the %Architecture% variable though. Can't figure out why he did that because you are right, something like %USMTArch% does seem to make more sense. Also I can't for the life of me figure out why both Windows Noob and Peter Van Der Woude insist on calling a batch script for the scanstate commands. I had problems with that left and right. The main issue was passing variables to the script as parameters. Kept getting my quotes and spaces in the wrong places. When i moved the commands themselves into the task sequence things got a lot easier. I'm planning to revisit the task sequence this week and try some of your suggestions. We'll see how it goes...

    That's probably how I will do it for now, but as you said there is probably a better way than mine also.

    There's ALWAYS a better way. Thats why I posed this here, I was hoping for feedback just like this. Thank you so much for contributing.

    Wednesday, March 23, 2011 4:07 PM
  • One problem I see with this is if you want to add steps to change from Windows XP (x86) to Windows 7 (x64) after the usmt capture you would have to boot in to x86 PE to do the capture and then reboot in to x64 PE to do the new deployment.  With this in mind I already know there is more tweaking needed to make it even more dynamic.  I'll have to think it over.

    Any help you can provide in making this more dynamic would be greatly appreciated. Also I don't know if you noticed but another shortcoming of this task sequence is the fact that it relies on the offline drive you wish to migrate being assigned the letter "C:". I have not figured any way around this yet either. If you have any ideas there I'd love to hear them.
    Wednesday, March 23, 2011 4:08 PM
  • As I'm reading your description on your set architecture variable I realize you are missing something.  You have the following description: "Set the OS architecture of the offline Windows partition you wish to migrate."  This actually isn't what you're doing.  You're actually selecting which architecture of USMT to use which should be basd on what architecture of PE you're in and not the arch of the Windows install to be migrated.  The architecture of the offline Windows install should be set using something like this or you could run in to errors.  See my post that follows for more info.

    You are correct, I knew what i was trying to do but my description was not entirely accurate. I'll look at your post and make adjustments accordingly.
    Wednesday, March 23, 2011 4:14 PM
  • Error: “The subsystem needed to support the image type is not present”

    This error is caused by running a 32-bit version of USMT within a 64-bit WinPE image. There are two rather obvious solutions to this:

    1. Use an x86 version of WinPE when running an x86 version of USMT.

    2. Use an x64 version of WinPE when running an X64 version of USMT.

    It’s fine to use x64 WinPE and USMT to run a scanstate on an x86 offline OS. Always remember to specify the environment variable for the offline OS architecture being scanned. This variable is:

    MIG_OFFLINE_PLATFORM_ARCH=<86 or 64>

    For example, if the offline OS being scanned was 32-bit Windows XP, you would specify the following in the WinPE command prompt that is about to run scanstate:

    SET MIG_OFFLINE_PLATFORM_ARCH=86

    ------credit to http://blogs.technet.com/b/askds/archive/2010/02/18/usmt-4-and-winpe-common-issues.aspx------

    As you can see if you don't specify this variable then you could have problems when you pick your task sequence that migrates an x64 install when you're in an x86 PE environment or vice versa.  So your way of picking task sequence based on the version of Windows to be migrated won't always work the way you currently have it coded.

    So if I understand this correctly, the variable I am currently using to set the USMT Architecture in my task sequence (%Architecture%) we all know to be a standard environment variable. Using this could cause issues for other scripts and task sequences so I should use something more USMT-specific. You are saying that a variable named %MIG_OFFLINE_PLATFORM_ARCH% already exists for this purpose? Okay I'll give that a shot. 
    Wednesday, March 23, 2011 4:20 PM
  • Brian,

    I made a mistake in some of my comments above. I was confusing the MDT CS.ini property variable %Architecture% with the Windows Environment variable %Processor_Architecture%. Here is the difference:

    %PROCESSOR_ARCHITECTURE% - Returns value "x86" for 32-Bit OS and Returns value "AMD64" for 64-Bit OS.

    %ARCHITECTURE% - Returns value "x86" for 32-Bit OS and Returns value "x64" for 64-Bit OS.

    Since my task sequence is just using these values to set the name of the USMT folder to use (x86 or x64) and since you pointed out that x64 Windows PE can migrate an x86 offline client I think the answer to our problem lies here. In theory all I need to do is have it perform a check to see if its running on the 64-Bit version of Windows PE and set the USMT folder name to x64. Under that setup the only time it should error out is if someone tried to use the x86 version of Windows PE to migrate an offline x64 OS (and I should be able to present an error message or something when that occurs). Let me play with this and get back to you...

    Wednesday, March 23, 2011 8:04 PM
  • The USMT Offline Migration Task Sequence:
    To use just open the deployment workbench and create a new custom task sequence. Close the workbench and browse to the task sequence location (usually <MyDeploymentShare>\Control\<MyCustomTaskSequenceID>\). Locate "ts.xml" (which should be the only file you see in the task sequence ID folder). Open it in a text editor and replace the code in that task sequence with the code between the lines below:
    --------------------------------------------------------------------------
    <?xml version="1.0" encoding="utf-8"?>
    <sequence version="3.00" name="Custom Task Sequence" description="Sample Custom Task Sequence">
     <group name="Initialization" disable="false" continueOnError="false" description="Initialize the TS environment" expand="true">
      <step type="BDD_Gather" name="Gather local only" disable="false" continueOnError="false" successCodeList="0 3010" description="" startIn="">
       <defaultVarList>
        <variable name="GatherLocalOnly" property="GatherLocalOnly">true</variable>
        <variable name="RulesFile" property="RulesFile"></variable>
       </defaultVarList>
       <action>cscript.exe "%SCRIPTROOT%\ZTIGather.wsf"</action>
      </step>
     </group>
     <group expand="true" name="State Capture (Offline)" description="" disable="false" continueOnError="false">
      <action />
      <step type="SMS_TaskSequence_SetVariableAction" name="Set USMT Architecture Path (x86)" description="Determine if the x86 version of Windows PE is running and set %USMTARCH% accordingly." disable="false" continueOnError="false" successCodeList="0 3010">
       <defaultVarList>
        <variable name="VariableName" property="VariableName">USMTArch</variable>
        <variable name="VariableValue" property="VariableValue">x86</variable>
       </defaultVarList>
       <action>cscript.exe "%SCRIPTROOT%\ZTISetVariable.wsf"</action>
       <condition>
        <operator type="and">
         <expression type="SMS_TaskSequence_VariableConditionExpression">
          <variable name="Variable">Architecture</variable>
          <variable name="Operator">equals</variable>
          <variable name="Value">x86</variable>
         </expression>
        </operator>
       </condition>
      </step>
      <step type="SMS_TaskSequence_SetVariableAction" name="Set USMT Architecture Path (x64)" description="Determine if the x64 version of Windows PE is running and set %USMTARCH% accordingly." disable="false" continueOnError="false" successCodeList="0 3010">
       <defaultVarList>
        <variable name="VariableName" property="VariableName">USMTArch</variable>
        <variable name="VariableValue" property="VariableValue">x64</variable>
       </defaultVarList>
       <action>cscript.exe "%SCRIPTROOT%\ZTISetVariable.wsf"</action>
       <condition>
        <operator type="and">
         <expression type="SMS_TaskSequence_VariableConditionExpression">
          <variable name="Variable">Architecture</variable>
          <variable name="Operator">equals</variable>
          <variable name="Value">x64</variable>
         </expression>
        </operator>
       </condition>
      </step>
      <step type="SMS_TaskSequence_SetVariableAction" name="Set Offline System Partition (C:)" description="If a Windows folder is found at a given drive letter set %OfflineSystemDrive% to that drive letter so the USMT files and folders can be cached there." disable="false" continueOnError="false" successCodeList="0 3010">
       <defaultVarList>
        <variable name="VariableName" property="VariableName">OfflineSystemDrive</variable>
        <variable name="VariableValue" property="VariableValue">C:</variable>
       </defaultVarList>
       <action>cscript.exe "%SCRIPTROOT%\ZTISetVariable.wsf"</action>
       <condition>
        <operator type="and">
         <expression type="SMS_TaskSequence_FolderConditionExpression">
          <variable name="Path">C:\Windows</variable>
         </expression>
        </operator>
       </condition>
      </step>
      <step type="SMS_TaskSequence_SetVariableAction" name="Set Offline System Partition (D:)" description="If a Windows folder is found at a given drive letter set %OfflineSystemDrive% to that drive letter so the USMT files and folders can be cached there." disable="false" continueOnError="false" successCodeList="0 3010">
       <defaultVarList>
        <variable name="VariableName" property="VariableName">OfflineSystemDrive</variable>
        <variable name="VariableValue" property="VariableValue">D:</variable>
       </defaultVarList>
       <action>cscript.exe "%SCRIPTROOT%\ZTISetVariable.wsf"</action>
       <condition>
        <operator type="and">
         <expression type="SMS_TaskSequence_FolderConditionExpression">
          <variable name="Path">D:\Windows</variable>
         </expression>
        </operator>
       </condition>
      </step>
      <step type="SMS_TaskSequence_SetVariableAction" name="Set Offline System Partition (E:)" description="If a Windows folder is found at a given drive letter set %OfflineSystemDrive% to that drive letter so the USMT files and folders can be cached there." disable="false" continueOnError="false" successCodeList="0 3010">
       <defaultVarList>
        <variable name="VariableName" property="VariableName">OfflineSystemDrive</variable>
        <variable name="VariableValue" property="VariableValue">E:</variable>
       </defaultVarList>
       <action>cscript.exe "%SCRIPTROOT%\ZTISetVariable.wsf"</action>
       <condition>
        <operator type="and">
         <expression type="SMS_TaskSequence_FolderConditionExpression">
          <variable name="Path">E:\Windows</variable>
         </expression>
        </operator>
       </condition>
      </step>
      <step type="SMS_TaskSequence_SetVariableAction" name="Set Offline System Partition (F:)" description="If a Windows folder is found at a given drive letter set %OfflineSystemDrive% to that drive letter so the USMT files and folders can be cached there." disable="false" continueOnError="false" successCodeList="0 3010">
       <defaultVarList>
        <variable name="VariableName" property="VariableName">OfflineSystemDrive</variable>
        <variable name="VariableValue" property="VariableValue">F:</variable>
       </defaultVarList>
       <action>cscript.exe "%SCRIPTROOT%\ZTISetVariable.wsf"</action>
       <condition>
        <operator type="and">
         <expression type="SMS_TaskSequence_FolderConditionExpression">
          <variable name="Path">F:\Windows</variable>
         </expression>
        </operator>
       </condition>
      </step>
      <step type="SMS_TaskSequence_SetVariableAction" name="Set Offline System Partition (G:)" description="If a Windows folder is found at a given drive letter set %OfflineSystemDrive% to that drive letter so the USMT files and folders can be cached there." disable="false" continueOnError="false" successCodeList="0 3010">
       <defaultVarList>
        <variable name="VariableName" property="VariableName">OfflineSystemDrive</variable>
        <variable name="VariableValue" property="VariableValue">G:</variable>
       </defaultVarList>
       <action>cscript.exe "%SCRIPTROOT%\ZTISetVariable.wsf"</action>
       <condition>
        <operator type="and">
         <expression type="SMS_TaskSequence_FolderConditionExpression">
          <variable name="Path">G:\Windows</variable>
         </expression>
        </operator>
       </condition>
      </step>
      <step type="SMS_TaskSequence_SetVariableAction" name="Set USMT Platform Architecture (32-Bit)" description="Determine if the offline system is a 32-bit Windows version and set %MIG_OFFLINE_PLATFORM_ARCH% accordingly." disable="false" continueOnError="false" successCodeList="0 3010">
       <defaultVarList>
        <variable name="VariableName" property="VariableName">MIG_OFFLINE_PLATFORM_ARCH</variable>
        <variable name="VariableValue" property="VariableValue">32</variable>
       </defaultVarList>
       <action>cscript.exe "%SCRIPTROOT%\ZTISetVariable.wsf"</action>
       <condition>
        <operator type="not">
         <expression type="SMS_TaskSequence_FolderConditionExpression">
          <variable name="Path">%OFFLINESYSTEMDRIVE%\Program Files (x86)</variable>
         </expression>
         <expression type="SMS_TaskSequence_FolderConditionExpression">
          <variable name="Path">%OFFLINESYSTEMDRIVE%\Windows\SysWOW64</variable>
         </expression>
        </operator>
       </condition>
      </step>
      <step type="SMS_TaskSequence_SetVariableAction" name="Set USMT Platform Architecture (64-Bit)" description="Determine if the offline system is a 64-bit Windows version and set %MIG_OFFLINE_PLATFORM_ARCH% accordingly." disable="false" continueOnError="false" successCodeList="0 3010">
       <defaultVarList>
        <variable name="VariableName" property="VariableName">MIG_OFFLINE_PLATFORM_ARCH</variable>
        <variable name="VariableValue" property="VariableValue">64</variable>
       </defaultVarList>
       <action>cscript.exe "%SCRIPTROOT%\ZTISetVariable.wsf"</action>
       <condition>
        <operator type="and">
         <expression type="SMS_TaskSequence_FolderConditionExpression">
          <variable name="Path">%OFFLINESYSTEMDRIVE%\Program Files (x86)</variable>
         </expression>
         <expression type="SMS_TaskSequence_FolderConditionExpression">
          <variable name="Path">%OFFLINESYSTEMDRIVE%\Windows\SysWOW64</variable>
         </expression>
        </operator>
       </condition>
      </step>
      <step type="SMS_TaskSequence_SetVariableAction" name="Set State Store Location" description="Set %OSDStateStorePath% to %UDShare%\%UDDir% so path names can be controlled by CS.ini (this will store migration data created by ScanState)." disable="false" continueOnError="false" successCodeList="0 3010">
       <defaultVarList>
        <variable name="VariableName" property="VariableName">OSDStateStorePath</variable>
        <variable name="VariableValue" property="VariableValue">%UDShare%\%UDDir%</variable>
       </defaultVarList>
       <action>cscript.exe "%SCRIPTROOT%\ZTISetVariable.wsf"</action>
      </step>
      <step type="SMS_TaskSequence_RunCommandLineAction" name="Create State Store Location" description="If it does not already exist then create a folder to store the user state migration files that will be generated by ScanState." disable="false" continueOnError="false" startIn="" successCodeList="0 3010" runIn="WinPEandFullOS">
       <defaultVarList>
        <variable name="PackageID" property="PackageID"></variable>
        <variable name="RunAsUser" property="RunAsUser">false</variable>
        <variable name="SMSTSRunCommandLineUserName" property="SMSTSRunCommandLineUserName"></variable>
        <variable name="SMSTSRunCommandLineUserPassword" property="SMSTSRunCommandLineUserPassword"></variable>
        <variable name="LoadProfile" property="LoadProfile">false</variable>
       </defaultVarList>
       <action>cmd.exe /c if not exist "%OSDSTATESTOREPATH%" md "%OSDSTATESTOREPATH%"</action>
      </step>
      <step type="SMS_TaskSequence_RunCommandLineAction" name="Cache USMT Files and Scripts" description="Copy USMT component files and scripts to a temporary location on the offline system partition." disable="false" continueOnError="false" startIn="" successCodeList="0 3010" runIn="WinPEandFullOS">
       <defaultVarList>
        <variable name="PackageID" property="PackageID"></variable>
        <variable name="RunAsUser" property="RunAsUser">false</variable>
        <variable name="SMSTSRunCommandLineUserName" property="SMSTSRunCommandLineUserName"></variable>
        <variable name="SMSTSRunCommandLineUserPassword" property="SMSTSRunCommandLineUserPassword"></variable>
        <variable name="LoadProfile" property="LoadProfile">false</variable>
       </defaultVarList>
       <action>xcopy "%DEPLOYROOT%\USMT\%USMTARCH%\*" "%OFFLINESYSTEMDRIVE%\USMTFiles\%USMTARCH%" /herciy</action>
      </step>
      <step type="SMS_TaskSequence_SetVariableAction" name="Set USMT Working Directory" description="Set the USMT working directory variable to the temporary location on the offline system partition where the USMT component files and scripts were copied." disable="false" continueOnError="false" successCodeList="0 3010">
       <defaultVarList>
        <variable name="VariableName" property="VariableName">USMT_WORKING_DIR</variable>
        <variable name="VariableValue" property="VariableValue">%OFFLINESYSTEMDRIVE%\USMTFiles\%USMTARCH%</variable>
       </defaultVarList>
       <action>cscript.exe "%SCRIPTROOT%\ZTISetVariable.wsf"</action>
      </step>
      <step type="SMS_TaskSequence_RunCommandLineAction" name="Capture User State (Offline)" description="Perform an offline USMT capture by running ScanState commands using variables in this task sequence, USMT-specific variables in CS.ini and an Offline.xml file." disable="false" continueOnError="false" startIn="" successCodeList="0 3010" runIn="WinPEandFullOS">
       <defaultVarList>
        <variable name="PackageID" property="PackageID" />
        <variable name="RunAsUser" property="RunAsUser">false</variable>
        <variable name="SMSTSRunCommandLineUserName" property="SMSTSRunCommandLineUserName"></variable>
        <variable name="SMSTSRunCommandLineUserPassword" property="SMSTSRunCommandLineUserPassword"></variable>
        <variable name="LoadProfile" property="LoadProfile">false</variable>
       </defaultVarList>
       <action>"%OFFLINESYSTEMDRIVE%\USMTFiles\%USMTARCH%\Scanstate.exe" "%OSDSTATESTOREPATH%" %SCANSTATEARGS% /i:"%OFFLINESYSTEMDRIVE%\USMTFiles\%USMTARCH%\MigApp.xml" /i:"%OFFLINESYSTEMDRIVE%\USMTFiles\%USMTARCH%\MigUser.xml" /i:"%OFFLINESYSTEMDRIVE%\USMTFiles\%USMTARCH%\MigCustomData.xml" /config:"%OFFLINESYSTEMDRIVE%\USMTFiles\%USMTARCH%\MigCustomConfig.xml" /offline:"%OFFLINESYSTEMDRIVE%\USMTFiles\%USMTARCH%\Offline.xml" /l:"%OFFLINESYSTEMDRIVE%\MININT\SMSOSD\OSDLOGS\USMTcapture.log" /progress:"%OFFLINESYSTEMDRIVE%\MININT\SMSOSD\OSDLOGS\USMTcapture.prg"</action>
      </step>
      <step type="SMS_TaskSequence_RunCommandLineAction" name="Clean Up USMT Files and Scripts" description="Remove any remaining temporary USMT component files and scripts from the offline system partition." disable="false" continueOnError="false" startIn="" successCodeList="0 3010" runIn="WinPEandFullOS">
       <defaultVarList>
        <variable name="PackageID" property="PackageID"></variable>
        <variable name="RunAsUser" property="RunAsUser">false</variable>
        <variable name="SMSTSRunCommandLineUserName" property="SMSTSRunCommandLineUserName"></variable>
        <variable name="SMSTSRunCommandLineUserPassword" property="SMSTSRunCommandLineUserPassword"></variable>
        <variable name="LoadProfile" property="LoadProfile">false</variable>
       </defaultVarList>
       <action>cmd.exe /c rd "%OFFLINESYSTEMDRIVE%\USMTFiles" /s /q</action>
      </step>
     </group>
    </sequence>
    --------------------------------------------------------------------------
    NOTE: This task sequence relies on another file named "Offline.xml". See my very first post above for details on creating thus file and where to put it.

    Thursday, March 24, 2011 3:23 AM
  • Brian,

    I did my best to update the task sequence use more "system agnostic" variables, add architecture detection and the ability to scan a range of drives (C-G) for migration targets. I feel like it adds another layer of complexity and I'm not 100% sure that there's some piece of logic I'm still missing that could cause it to "break", but so far its working really well in all my tests.

    Please take a look at it and let me know what you think.

    Thursday, March 24, 2011 3:28 AM
  • I'm looking over your steps and I like what you've done with it.  Couple things I'm curious about.  If the value of %architecture% is either x86 or x64 (instead of the x86 or AMD64 as originally thought) then I don't see why we need to use %USMTArch%.  Why not just use %architecture% as it will already hold the value we want?

    Looking at your "Set USMT Platform Architecture" step I feel like it should be called "Set Offline Platform Architecture".  Really that's what we're doing.  Has nothing to do with USMT architecture as you could actually use USMT x86 or migrate an offline x64 install (although we aren't doing that here).  No matter what you call it I think there needs to be another step like that to determine if the offlineWinDir is x86 as well.  That way if we boot in to x64 PE we can migrate an x86 offlineWinDir without USMT getting confused as to what type of OS is being migrated.

    Lastly, I noticed you have two scanstate steps.  One that uses OfflineWinDir and one that uses offline.xml (which is the enabled one).  I don't have an offline.xml.  Where did you get that?  Why did you decide to use that over offlineWinDir?

    I have a busy day today, but I'd like to try this out myself.  Unfortunately I probably won't get to it until tomorrow.  Great work though.


    Thursday, March 24, 2011 1:29 PM
  • Also if you only ever set %MIG_OFFLINE_PLATFORM_ARCH% to 64 then I don't think you will be able to migrate an x86 offlinewindir.  Here's how I did that:

     <step type="SMS_TaskSequence_SetVariableAction" name="Set offline Win arch if x64" description="determines if architecture of offline WinDir is x64" disable="false" continueOnError="false" successCodeList="0 3010">
          <defaultVarList>
            <variable name="VariableName" property="VariableName">MIG_OFFLINE_PLATFORM_ARCH</variable>
            <variable name="VariableValue" property="VariableValue">x64</variable>
          </defaultVarList>
          <action>cscript.exe "%SCRIPTROOT%\ZTISetVariable.wsf"</action>
          <condition>
            <operator type="and" />
            <expression type="SMS_TaskSequence_FolderConditionExpression">
              <variable name="Path">C:\Program Files (x86)</variable>
            </expression>
          </condition>
        </step>
        <step type="SMS_TaskSequence_SetVariableAction" name="Set offline Win arch if x86" description="determines if architecture of offline WinDir is x86" disable="false" continueOnError="false" successCodeList="0 3010">
          <defaultVarList>
            <variable name="VariableName" property="VariableName">MIG_OFFLINE_PLATFORM_ARCH</variable>
            <variable name="VariableValue" property="VariableValue">x86</variable>
          </defaultVarList>
          <action>cscript.exe "%SCRIPTROOT%\ZTISetVariable.wsf"</action>
          <condition>
            <operator type="not" />
            <expression type="SMS_TaskSequence_FolderConditionExpression">
              <variable name="Path">C:\Program Files (x86)</variable>
            </expression>
          </condition>
        </step>

    Thursday, March 24, 2011 1:34 PM
  • Also if you only ever set %MIG_OFFLINE_PLATFORM_ARCH% to 64 then I don't think you will be able to migrate an x86 offlinewindir.

    Actually I decided to only include logic to set %MIG_OFFLINE_PLATFORM_ARCH% to 64 because of this comment made by you above:

    It’s fine to use x64 WinPE and USMT to run a scanstate on an x86 offline OS. Always remember to specify the environment variable for the offline OS architecture being scanned.

    Since Windows PE x64 + USMT x64 can successfully migrate an x86 offline Windows partition and %MIG_OFFLINE_PLATFORM_ARCH% supposedly defaults to x86 I figure the only time it needs to be changed is when an x64 Windows Partition is detected. So I saw no reason to set it to x86. FYI I tested Windows PE x64 + USMT x64 on an offline x86 partition several times and it migrated just fine. What do you think?

    Thursday, March 24, 2011 2:33 PM
  • I'm looking over your steps and I like what you've done with it.  Couple things I'm curious about.  If the value of %architecture% is either x86 or x64 (instead of the x86 or AMD64 as originally thought) then I don't see why we need to use %USMTArch%.  Why not just use %architecture% as it will already hold the value we want?

    As I recall I did actually have a good reason for doing it that way, but i'll reexamine it and see if I can recall my reasoning there and if its no longer valid I'll change it. 

    Looking at your "Set USMT Platform Architecture" step I feel like it should be called "Set Offline Platform Architecture".  Really that's what we're doing.  Has nothing to do with USMT architecture as you could actually use USMT x86 or migrate an offline x64 install (although we aren't doing that here).  No matter what you call it I think there needs to be another step like that to determine if the offlineWinDir is x86 as well.  That way if we boot in to x64 PE we can migrate an x86 offlineWinDir without USMT getting confused as to what type of OS is being migrated.

    I don't know that i agree with this actually. I mean yeah you are right to a degree but (in my head) that step is just setting a value that will correspond to the working directory for USMT (i.e. the "x86" and "x64" in "C:\USMT\x86" or "C:\USMT\x64"). I'll reexamine it and think over what you said though. Also i think we only need to detect wether or not the offline WIndows Dir is x64. See my response to another comment you made below about set %MIG_OFFLINE_PLATFORM_ARCH% to 64. I may be wrong though, so call me out on it if I am.

    Lastly, I noticed you have two scanstate steps.  One that uses OfflineWinDir and one that uses offline.xml (which is the enabled one).  I don't have an offline.xml.  Where did you get that?  Why did you decide to use that over offlineWinDir?

    I actually edited my top post to explain this, but here you go (the offline.xml code I used is also posted above):

    x64 Offline.xml and offlineWinDir:

    Part of running USMT in offline mode involves specifying the path to the Windows directory of the drive you wish to migrate. My task sequence supports the following 2 methods:

    /offline: <path to offline.xml>:

    This command-line option enables the offline-migration mode and requires a path to an Offline.xml configuration file.

    /offlineWinDir: <Windows directory>:

    This command-line option enables the offline-migration mode and starts the migration from the location specified. It is only for use in Windows PE offline scenarios where the migration is occurring from a Windows directory.

    More information on this subject can be found here:

    http://technet.microsoft.com/en-us/library/ee126219(WS.10).aspx 

    Of these methods I prefer using an offline.xml file to detect the Windows dir in my drive range (C-G) as it seems to offer the greatest level of flexibility. With offline.xml you can actually change some values to have USMT migrate multiple drives in sequence, this could be useful for migrating a dual boot system. My task sequence supports /offlineWinDir but it is currently disabled. If you want to use /offlineWinDir just re-enable it and make sure you aslo disable offline.xml.

    I have a busy day today, but I'd like to try this out myself.  Unfortunately I probably won't get to it until tomorrow.  Great work though.

    Yeah we are making really good progress here. I think we are just a revision or two away from having an offline migration task sequence that can account for just about any configuration (thats not just waayy outside the norm). I'll keep testing and revising...

    Thursday, March 24, 2011 2:51 PM
  • that step is just setting a value that will correspond to the working directory for USMT (i.e. the "x86" and "x64" in "C:\USMT\x86" or "C:\USMT\x64").

    This is not the case though.  The value tells USMT what the architecture is for the offlinewindir.  It may or may not correspond ot the working directory for USMT.  You could have a working directory of c:\USMT\x64 and have %MIG_OFFLINE_PLATFORM_ARCH% set to 86.  I believe you mentioned this scenario in your post above actually.

    ---"%MIG_OFFLINE_PLATFORM_ARCH% supposedly defaults to x86 I figure the only time it needs to be changed is when an x64 Windows Partition is detected."---

    I was not aware this was the case.  So if I boot PE x64 and therefore I'm using USMT x64 tools are you saying the value of %MIG_OFFLINE_PLATFORM_ARCH% will still default to 86?  If so then I guess you could skip setting the value to 86 when applicable.  I still think I'd prefer setting it myself just so I know it's correct.

    Sorry for the confusion on this.


    Thursday, March 24, 2011 3:39 PM
  • that step is just setting a value that will correspond to the working directory for USMT (i.e. the "x86" and "x64" in "C:\USMT\x86" or "C:\USMT\x64").

    This is not the case though.  The value tells USMT what the architecture is for the offlinewindir.  It may or may not correspond ot the working directory for USMT.  You could have a working directory of c:\USMT\x64 and have %MIG_OFFLINE_PLATFORM_ARCH% set to 86.  I believe you mentioned this scenario in your post above actually.

    ---"%MIG_OFFLINE_PLATFORM_ARCH% supposedly defaults to x86 I figure the only time it needs to be changed is when an x64 Windows Partition is detected."---

    I was not aware this was the case.  So if I boot PE x64 and therefore I'm using USMT x64 tools are you saying the value of %MIG_OFFLINE_PLATFORM_ARCH% will still default to 86?  If so then I guess you could skip setting the value to 86 when applicable.  I still think I'd prefer setting it myself just so I know it's correct.

    Sorry for the confusion on this.


    Check here:

    http://technet.microsoft.com/en-us/library/dd560758(WS.10).aspx

    Here's the part on %MIG_OFFLINE_PLATFORM_ARCH%:

    While operating offline, this environment variable defines the architecture of the offline system, if the system does not match the Windows PE and Scanstate.exe architecture. This environment variable enables the 32-bit ScanState application to gather data from a computer with 64-bit architecture, or the 64-bit ScanState application to gather data from a computer with 32-bit architecture. This is required when auto-detection of the offline architecture doesn’t function properly, for example, when the source system is running a 64-bit version of Windows XP.

    So judging from that it seems the that 32-bit version of and the 64-Bit version USMT can actually migrate *any* architecture, you just have to tell it which architecture you want to migrate with %MIG_OFFLINE_PLATFORM_ARCH%. As for the part about it defaulting to 32-bit, of course that would be the one thing I cant find the reference to now (lol). However I remember reading through one of the USMT articles on TechNet on using the x64 version of USMT and it was quick to point out that you had to be really careful with the x64 version of USMT in offline mode because it just assumes the target to be migrated is 32-bit unless specified otherwise (just like the x86 version). If it makes you feel better though I can look into setting that value somehow...

    Thursday, March 24, 2011 4:12 PM
  •  

    Okay Brian,

    I modified the task sequence code again. Here are the changes: 

    %USMTARCH%:

    I decided to leave %USMTARCH% in there because I just prefer setting a custom variable for this step. However I did adjust my description so (hopefully) what I'm doing there makes more sense now. 

    %MIG_OFFLINE_PLATFORM_ARCH%:

    Since you wanted to give us an additional safety-net here I added the 32-Bit check/set for %MIG_OFFLINE_PLATFORM_ARCH% (Quick aside on your comments above regarding this. The values you mention for this variable "MIG_OFFLINE_PLATFORM_ARCH=<86 or 64>" are actually incorrect, the values you are supposed to specify are "MIG_OFFLINE_PLATFORM_ARCH=<32 or 64>". However I think that was just a typo on the website you copied and pasted that from. Just wanted to point it out to avoid any further confusion here). Also just checking for the existance ot "%OFFLINESYSTEMDRIVE%\Program Files (x86)" did not sit well with me as that folder can be visible to certain end users. I've actually seen a few people create that folder on their local hard drives to try and solve problems (when they obviously didn't know at it really was used for). So as a precaution I added a 2nd condition to check for the existance of "%OFFLINESYSTEMDRIVE%\Windows\SysWOW64" when determining if the migration target is 64-Bit. I figure if BOTH those folders exist on the migration target then at least 99% of the time you can be certain you've got a 64-bit Windows install on your hands.

    /offlineWinDir:

    I decided to kill this part off. I just think Offline.xml is a lot more flexible.

    I've tested the modified task sequence a few times already this morning and I'm pretty satisfied with it. It seems stable and (so far) "just works". Unless you find any other items I may have missed I'm going to put it into production next week and see how it goes. Please let me know how you come out in your testing.


    Thursday, March 24, 2011 5:21 PM
  • Sounds good I'll look at this tomorrow hopefully.
    Thursday, March 24, 2011 9:39 PM
  • So far so good.  Seems to be working.  I tested it in PE x86 using a Windows XP (x86) OfflineWinDir.  Also tested it with PE x64 using a Windows XP (x86) OfflineWinDir.

    In my Task Sequence I decided to get rid of the %USMTARCH% since there is no need for it.  I understand you decided to keep it, but for me I'd rather keep my task sequence as short and sweet as possible. KISS right?

    I'm also using the OfflineWinDir instead of offline.xml.  Offline.xml may be more flexible, but in it's current state I believe it works identically?  Again another KISS thing I guess.

    The next thing I would like to do is figure out how to call my "Deploy Windows 7" immediately after finishing the offline USMT capture.  I would like to put that in a seperate task sequence.  That way I could either do an offline USMT capture and then deploy to a different machine or I could basically do an offline refresh to the same machine.

    At first I was thinking I could just copy the offline USMT task and then at the end past in the steps for the "Deploy Win7" task sequence.  The problem with that is if I have to modify my "Deploy Win7" task sequence then I also have to remember to update the "Offline Refresh" task sequence.  That's more work and room for error.  I'm not sure how to do it yet, but I think I would like to somehow call the existing "Deploy Win7" sequence from the "Offline Refresh" sequence.

    Friday, March 25, 2011 6:16 PM
  • So far so good.  Seems to be working.  I tested it in PE x86 using a Windows XP (x86) OfflineWinDir.  Also tested it with PE x64 using a Windows XP (x86) OfflineWinDir.

    In my Task Sequence I decided to get rid of the %USMTARCH% since there is no need for it.  I understand you decided to keep it, but for me I'd rather keep my task sequence as short and sweet as possible. KISS right?

    I'm also using the OfflineWinDir instead of offline.xml.  Offline.xml may be more flexible, but in it's current state I believe it works identically?  Again another KISS thing I guess.

    The next thing I would like to do is figure out how to call my "Deploy Windows 7" immediately after finishing the offline USMT capture.  I would like to put that in a seperate task sequence.  That way I could either do an offline USMT capture and then deploy to a different machine or I could basically do an offline refresh to the same machine.

    At first I was thinking I could just copy the offline USMT task and then at the end past in the steps for the "Deploy Win7" task sequence.  The problem with that is if I have to modify my "Deploy Win7" task sequence then I also have to remember to update the "Offline Refresh" task sequence.  That's more work and room for error.  I'm not sure how to do it yet, but I think I would like to somehow call the existing "Deploy Win7" sequence from the "Offline Refresh" sequence.

    Best of luck to you in that and I hope you get it working. For me thought hats a bit out of scope from what I'm tryign to accomplish.

    ;)

    Glad to have given you a head-start though! Hopefully some other people around here will find this useful.

    Saturday, March 26, 2011 3:50 AM
  • Thank you very much for the work you've done on this.
    Saturday, March 26, 2011 1:52 PM
  • Zeus,  could you post your custom setting.ini file here, I have just begun doing this at work and am very much a beginner in Win 7 deployment, id' like to see what your ScanStateArgs are, I can only run USMT at the moment through a shared drive in DOS and would love to be able to do it all offline.  Thanks for your help.

    Friday, June 10, 2011 5:29 PM
  • I realize your request wasn't for me, but it's confusing the way you wrote it.  Pretty sure USMT won't run in DOS.  I assume you mean the command line in WinPE?  Or command line in Windows?  If it's in PE then that is "offline".  When we say offline we mean you aren't booted to the installed operating system, but rather you're running in WinPE.  Are we on the same page?

    Monday, June 13, 2011 12:45 PM
  • Yeah I'm booting from PXE to winPE and then attempting to run the task from there, however, I'm having alot of issues and I'm hearing from others that USMT can only be done online.  I have followed the above advice but when I boot into PE and run the task I get lots of errors, I'm not at work right now but can post what I get tomorrow, theoretically can it be done?

    Thanks in advance.

    This is the error that I receive:

    Litetouch deployment failed = return code = -2147467259 0x80004005

    An attempt was made to load a program with an incorrect format (Error:0000000B; Source: Windows)

    Monday, June 13, 2011 9:37 PM
  • It can definitely be done.  This functionality was added in USMT 4.  Make sure you have USMT 4 files in your deployment share as USMT 3 won't work.  Did you copy the task sequence XML from the one Zeus posted above?  Just create a new custom task sequence called OfflineUSMT and then go find the TS.XML file that is created in \\%deployroot%\Control\OfflineUSMT .  Open it in notepad and copy/paste in his code and save the file.  Then if you go back and look at the task sequence in the Deployment Workbench it should have all the steps populated that you need.  That should work.  In a few months when MDT 2012 is released I believe it will have this funcationality built in.  I did mine slightly different than Zeus if you want to try mine, but his should work too.  I have these lines in the default section of my CustomSettings.ini:

    UDShare=\\mydeploymentserver\MigData$
    UDDir=%OSDComputerName%
    UserDataLocation=AUTO
    ScanStateArgs=/v:5 /o /c
    LoadStateArgs=/v:5 /c /lac

    And here's what my TS.XML looks like:

     

    <?xml version="1.0" encoding="utf-8"?>
    <sequence version="3.00" name="Custom Task Sequence" description="Sample Custom Task Sequence">
      <group name="Initialization" disable="false" continueOnError="false" description="Initialize the TS environment" expand="true">
        <step type="BDD_Gather" name="Gather local only" disable="false" continueOnError="false" successCodeList="0 3010" description="" startIn="">
          <defaultVarList>
            <variable name="GatherLocalOnly" property="GatherLocalOnly">true</variable>
            <variable name="RulesFile" property="RulesFile"></variable>
          </defaultVarList>
          <action>cscript.exe "%SCRIPTROOT%\ZTIGather.wsf"</action>
        </step>
      </group>
      <group expand="true" name="State Capture (Offline)" description="" disable="false" continueOnError="false">
        <action />
        <step type="SMS_TaskSequence_SetVariableAction" name="Set Offline System Partition (C:)" description="If a Windows folder is found at a given drive letter set %OfflineSystemDrive% to that drive letter so the USMT files and folders can be cached there." disable="false" continueOnError="false" successCodeList="0 3010">
          <defaultVarList>
            <variable name="VariableName" property="VariableName">OfflineSystemDrive</variable>
            <variable name="VariableValue" property="VariableValue">C:</variable>
          </defaultVarList>
          <action>cscript.exe "%SCRIPTROOT%\ZTISetVariable.wsf"</action>
          <condition>
            <operator type="and">
              <expression type="SMS_TaskSequence_FolderConditionExpression">
                <variable name="Path">C:\Windows</variable>
              </expression>
            </operator>
          </condition>
        </step>
        <step type="SMS_TaskSequence_SetVariableAction" name="Set Offline System Partition (D:)" description="If a Windows folder is found at a given drive letter set %OfflineSystemDrive% to that drive letter so the USMT files and folders can be cached there." disable="false" continueOnError="false" successCodeList="0 3010">
          <defaultVarList>
            <variable name="VariableName" property="VariableName">OfflineSystemDrive</variable>
            <variable name="VariableValue" property="VariableValue">D:</variable>
          </defaultVarList>
          <action>cscript.exe "%SCRIPTROOT%\ZTISetVariable.wsf"</action>
          <condition>
            <operator type="and">
              <expression type="SMS_TaskSequence_FolderConditionExpression">
                <variable name="Path">D:\Windows</variable>
              </expression>
            </operator>
          </condition>
        </step>
        <step type="SMS_TaskSequence_SetVariableAction" name="Set Offline System Partition (E:)" description="If a Windows folder is found at a given drive letter set %OfflineSystemDrive% to that drive letter so the USMT files and folders can be cached there." disable="false" continueOnError="false" successCodeList="0 3010">
          <defaultVarList>
            <variable name="VariableName" property="VariableName">OfflineSystemDrive</variable>
            <variable name="VariableValue" property="VariableValue">E:</variable>
          </defaultVarList>
          <action>cscript.exe "%SCRIPTROOT%\ZTISetVariable.wsf"</action>
          <condition>
            <operator type="and">
              <expression type="SMS_TaskSequence_FolderConditionExpression">
                <variable name="Path">E:\Windows</variable>
              </expression>
            </operator>
          </condition>
        </step>
        <step type="SMS_TaskSequence_SetVariableAction" name="Set Offline System Partition (F:)" description="If a Windows folder is found at a given drive letter set %OfflineSystemDrive% to that drive letter so the USMT files and folders can be cached there." disable="false" continueOnError="false" successCodeList="0 3010">
          <defaultVarList>
            <variable name="VariableName" property="VariableName">OfflineSystemDrive</variable>
            <variable name="VariableValue" property="VariableValue">F:</variable>
          </defaultVarList>
          <action>cscript.exe "%SCRIPTROOT%\ZTISetVariable.wsf"</action>
          <condition>
            <operator type="and">
              <expression type="SMS_TaskSequence_FolderConditionExpression">
                <variable name="Path">F:\Windows</variable>
              </expression>
            </operator>
          </condition>
        </step>
        <step type="SMS_TaskSequence_SetVariableAction" name="Set Offline System Partition (G:)" description="If a Windows folder is found at a given drive letter set %OfflineSystemDrive% to that drive letter so the USMT files and folders can be cached there." disable="false" continueOnError="false" successCodeList="0 3010">
          <defaultVarList>
            <variable name="VariableName" property="VariableName">OfflineSystemDrive</variable>
            <variable name="VariableValue" property="VariableValue">G:</variable>
          </defaultVarList>
          <action>cscript.exe "%SCRIPTROOT%\ZTISetVariable.wsf"</action>
          <condition>
            <operator type="and">
              <expression type="SMS_TaskSequence_FolderConditionExpression">
                <variable name="Path">G:\Windows</variable>
              </expression>
            </operator>
          </condition>
        </step>
        <step type="SMS_TaskSequence_SetVariableAction" name="Set Architecture x64" description="Determine if the offline system is 64-bit Windows and set %MIG_OFFLINE_PLATFORM_ARCH% accordingly." disable="false" continueOnError="false" successCodeList="0 3010">
          <defaultVarList>
            <variable name="VariableName" property="VariableName">MIG_OFFLINE_PLATFORM_ARCH</variable>
            <variable name="VariableValue" property="VariableValue">64</variable>
          </defaultVarList>
          <action>cscript.exe "%SCRIPTROOT%\ZTISetVariable.wsf"</action>
          <condition>
            <operator type="and">
              <expression type="SMS_TaskSequence_FolderConditionExpression">
                <variable name="Path">%OFFLINESYSTEMDRIVE%\Program Files (x86)</variable>
              </expression>
            </operator>
          </condition>
        </step>
        <step type="SMS_TaskSequence_SetVariableAction" name="Set Architecture x86" description="Determine if the offline system is 32-bit Windows and set %MIG_OFFLINE_PLATFORM_ARCH% accordingly." disable="false" continueOnError="false" successCodeList="0 3010">
          <defaultVarList>
            <variable name="VariableName" property="VariableName">MIG_OFFLINE_PLATFORM_ARCH</variable>
            <variable name="VariableValue" property="VariableValue">86</variable>
          </defaultVarList>
          <action>cscript.exe "%SCRIPTROOT%\ZTISetVariable.wsf"</action>
          <condition>
            <operator type="not" />
            <expression type="SMS_TaskSequence_FolderConditionExpression">
              <variable name="Path">%OFFLINESYSTEMDRIVE%\Program Files (x86)</variable>
            </expression>
          </condition>
        </step>
        <step type="SMS_TaskSequence_SetVariableAction" name="Set State Store Location" description="Set %OSDStateStorePath% to %UDShare%\%UDDir% so path names can be controlled by CS.ini (this will store migration data created by scanstate.exe)." disable="false" continueOnError="false" successCodeList="0 3010">
          <defaultVarList>
            <variable name="VariableName" property="VariableName">OSDStateStorePath</variable>
            <variable name="VariableValue" property="VariableValue">%UDShare%\%UDDir%</variable>
          </defaultVarList>
          <action>cscript.exe "%SCRIPTROOT%\ZTISetVariable.wsf"</action>
        </step>
        <step type="SMS_TaskSequence_RunCommandLineAction" name="Create State Store Location" description="If it does not already exist create a folder to store the user state migration files generated by scanstate.exe." disable="false" continueOnError="false" startIn="" successCodeList="0 3010" runIn="WinPEandFullOS">
          <defaultVarList>
            <variable name="PackageID" property="PackageID"></variable>
            <variable name="RunAsUser" property="RunAsUser">false</variable>
            <variable name="SMSTSRunCommandLineUserName" property="SMSTSRunCommandLineUserName"></variable>
            <variable name="SMSTSRunCommandLineUserPassword" property="SMSTSRunCommandLineUserPassword"></variable>
            <variable name="LoadProfile" property="LoadProfile">false</variable>
          </defaultVarList>
          <action>cmd.exe /c if not exist "%OSDSTATESTOREPATH%" md "%OSDSTATESTOREPATH%"</action>
        </step>
        <step type="SMS_TaskSequence_RunCommandLineAction" name="Cache USMT Files and Scripts" description="Copy the USMT component files and scripts to a temporary location on the offline system partition." disable="false" continueOnError="false" startIn="" successCodeList="0 3010" runIn="WinPEandFullOS">
          <defaultVarList>
            <variable name="PackageID" property="PackageID"></variable>
            <variable name="RunAsUser" property="RunAsUser">false</variable>
            <variable name="SMSTSRunCommandLineUserName" property="SMSTSRunCommandLineUserName"></variable>
            <variable name="SMSTSRunCommandLineUserPassword" property="SMSTSRunCommandLineUserPassword"></variable>
            <variable name="LoadProfile" property="LoadProfile">false</variable>
          </defaultVarList>
          <action>xcopy "%DEPLOYROOT%\USMT\%ARCHITECTURE%\*" "%OFFLINESYSTEMDRIVE%\USMTFiles\%ARCHITECTURE%" /herciy</action>
        </step>
        <step type="SMS_TaskSequence_SetVariableAction" name="Set USMT Working Directory" description="Set the USMT working directory variable to the temporary location on the offline system partition where the USMT component files and scripts were copied." disable="false" continueOnError="false" successCodeList="0 3010">
          <defaultVarList>
            <variable name="VariableName" property="VariableName">USMT_WORKING_DIR</variable>
            <variable name="VariableValue" property="VariableValue">%OFFLINESYSTEMDRIVE%\USMTFiles\%USMTARCH%</variable>
          </defaultVarList>
          <action>cscript.exe "%SCRIPTROOT%\ZTISetVariable.wsf"</action>
        </step>
        <step type="SMS_TaskSequence_RunCommandLineAction" name="Capture User State (with OfflineWinDir)" description="Perform offline USMT capture by running scanstate.exe commands with variables set by this task sequence and USMT-specific variables in CS.ini." disable="false" continueOnError="false" startIn="" successCodeList="0 3010" runIn="WinPEandFullOS">
          <defaultVarList>
            <variable name="PackageID" property="PackageID"></variable>
            <variable name="RunAsUser" property="RunAsUser">false</variable>
            <variable name="SMSTSRunCommandLineUserName" property="SMSTSRunCommandLineUserName"></variable>
            <variable name="SMSTSRunCommandLineUserPassword" property="SMSTSRunCommandLineUserPassword"></variable>
            <variable name="LoadProfile" property="LoadProfile">false</variable>
          </defaultVarList>
          <action>"%OFFLINESYSTEMDRIVE%\USMTFiles\%ARCHITECTURE%\Scanstate.exe" "%OSDSTATESTOREPATH%" %SCANSTATEARGS% /i:"%OFFLINESYSTEMDRIVE%\USMTFiles\%ARCHITECTURE%\MigApp.xml" /i:"%OFFLINESYSTEMDRIVE%\USMTFiles\%ARCHITECTURE%\MigUser.xml" /i:"%OFFLINESYSTEMDRIVE%\USMTFiles\%ARCHITECTURE%\MigDocs.xml" /offlineWinDir:"%OFFLINESYSTEMDRIVE%\Windows" /l:"%OFFLINESYSTEMDRIVE%\MININT\SMSOSD\OSDLOGS\USMTcapture.log"</action>
        </step>
        <step type="SMS_TaskSequence_RunCommandLineAction" name="Capture User State (with Offline.xml)" description="Perform offline USMT capture by running scanstate.exe commands with variables set by this task sequence and USMT-specific variables in CS.ini." disable="true" continueOnError="false" startIn="" successCodeList="0 3010" runIn="WinPEandFullOS">
          <defaultVarList>
            <variable name="PackageID" property="PackageID" />
            <variable name="RunAsUser" property="RunAsUser">false</variable>
            <variable name="SMSTSRunCommandLineUserName" property="SMSTSRunCommandLineUserName"></variable>
            <variable name="SMSTSRunCommandLineUserPassword" property="SMSTSRunCommandLineUserPassword"></variable>
            <variable name="LoadProfile" property="LoadProfile">false</variable>
          </defaultVarList>
          <action>"%OFFLINESYSTEMDRIVE%\USMTFiles\%USMTARCH%\Scanstate.exe" "%OSDSTATESTOREPATH%" %SCANSTATEARGS% /i:"%OFFLINESYSTEMDRIVE%\USMTFiles\%USMTARCH%\MigApp.xml" /i:"%OFFLINESYSTEMDRIVE%\USMTFiles\%USMTARCH%\MigUser.xml" /i:"%OFFLINESYSTEMDRIVE%\USMTFiles\%USMTARCH%\MigCustomData.xml" /config:"%OFFLINESYSTEMDRIVE%\USMTFiles\%USMTARCH%\MigCustomConfig.xml" /offline:"%OFFLINESYSTEMDRIVE%\USMTFiles\%USMTARCH%\Offline.xml" /l:"%OFFLINESYSTEMDRIVE%\MININT\SMSOSD\OSDLOGS\USMTcapture.log" /progress:"%OFFLINESYSTEMDRIVE%\MININT\SMSOSD\OSDLOGS\USMTcapture.prg"</action>
        </step>
        <step type="SMS_TaskSequence_RunCommandLineAction" name="Clean Up USMT Files and Scripts" description="Remove any remaining temporary USMT component files and scripts from the offline system partition." disable="false" continueOnError="false" startIn="" successCodeList="0 3010" runIn="WinPEandFullOS">
          <defaultVarList>
            <variable name="PackageID" property="PackageID"></variable>
            <variable name="RunAsUser" property="RunAsUser">false</variable>
            <variable name="SMSTSRunCommandLineUserName" property="SMSTSRunCommandLineUserName"></variable>
            <variable name="SMSTSRunCommandLineUserPassword" property="SMSTSRunCommandLineUserPassword"></variable>
            <variable name="LoadProfile" property="LoadProfile">false</variable>
          </defaultVarList>
          <action>cmd.exe /c rd "%OFFLINESYSTEMDRIVE%\USMTFiles" /s /q</action>
        </step>
      </group>
    </sequence>

    Monday, June 13, 2011 10:33 PM
  • OK I have edited the job to include your data above with the Offline.xml job disabled and I am still receiving errors.

    It fails on the step Capture User State (with OfflineWinDir) error message reads 'the system cannot write to the specified device. (Error:0000001D; Source: Windows

    I take it this means it cannot write to the Windows directory on the client I am trying to perform the USMT on?  Here is a copy of my cs.ini file:

    [Settings]

    Priority=Default

    Properties=MyCustomProperty

    [Default]

    OSInstall=Y

    SkipAppsOnUpgrade=YES

    UDShare=\\LONBACKUP\DeploymentShare$

    UDDir=%OSDComputerName%

    UserDataLocation=AUTO

    ScanStateArgs=/v:5 /o /c

    LoadStateArgs=/v:5 /c /lac

    I'll have a look around and try some other things but any help you can provide is appreciated, thank you.

    Tuesday, June 14, 2011 8:32 AM
  • OK Having looked at the log file for USMTCapture it says that the X: drive has too little space, so it seems that the USMT_WORKING_DIRECTORY command is not working, which is strange as I copied the code exactly as above form your task, do I need to change anything in the offline.xml file or anywhere else for this to work?
    Tuesday, June 14, 2011 9:14 AM
  • hmm...it's been a while since I looked at this very closely.  X: should be the WinPE ram drive from boot.  Not sure why it would be trying to write to that location.  The offline.xml is not being used in my task sequence so it won't matter if you change it or have it at all.  Zeus explains the use of the offline.xml method above.  Try to go through the steps manually on the system giving you trouble.  Run diskpart and find which drive letter is being assigned that has the offline Windows install with settings to be migrated.  It has to be assigned a letter between C and G or it will not work.  Try to access each location that is used during the task sequence.  You should be able to find what step has the problem and exactly what the problem is if you go through it step by step.
    Tuesday, June 14, 2011 12:50 PM
  • If I press F8 after the job has failed to bring up the command Window, I can set USMT_WORKING_DIRECTORY=C:\ then If I run the capture command it works no problem.
    If I run the task again and fail it as it has been if I open the USMTCapture.log file it says:
    Command Line: C:\USMTFiles\X86\Scanstate.exe \\LONBACKUP\Profiles\MININT-50KTNTN /v:5 /o /c /i:C:\USMTFiles etc
    Then the failure message of Drive X:\ has 30MB Free min 250MB is required etc
    My point is this - in the code of your task you have:
    %OFFLINESYSTEMDRIVE%\USMTFiles\%USMTARCH%\Scanstate.exe" "%OSDSTATESTOREPATH%" %SCANSTATEARGS% /i:"%OFFLINESYSTEMDRIVE%\USMTFiles\%USMTARCH%\MigApp.xml" /i:"%OFFLINESYSTEMDRIVE%\USMTFiles\%USMTARCH%\MigUser.xml" /i:"%OFFLINESYSTEMDRIVE%\USMTFiles\%USMTARCH%\MigCustomData.xml" /config:"%OFFLINESYSTEMDRIVE%\USMTFiles\%USMTARCH%\MigCustomConfig.xml" /offline:"%OFFLINESYSTEMDRIVE%\USMTFiles\%USMTARCH%\Offline.xml" /l:"%OFFLINESYSTEMDRIVE%\MININT\SMSOSD\OSDLOGS\USMTcapture.log" /progress:"%OFFLINESYSTEMDRIVE%\MININT\SMSOSD\OSDLOGS\USMTcapture.prg"</action>
    And you can see from my log file output the %OFFLINESYSTEMDRIVE% is pointing at C:\USMTFiles\X86, I dont know why all of a sudden it would see it as the X: ramdrive again.  Any thoughts?  Thanks again for all your help.

    Tuesday, June 14, 2011 1:16 PM
  • I'm not sure I follow what you're getting at quite yet, but let's clear up a few things to help us get on the same page.

    The line you posted in your last reply is not used.  That's the disabled step that would use offline.xml.

    Also, %OFFLINESYSTEMDRIVE% should be set to c:\ and not c:\USMTFiles\x86 as you said.  %OFFLINESYSTEMDRIVE%/USMTFiles/%USMTARCH% could however be set to c:\USMTFiles\x86.  Is that what you meant to say?

    "And you can see from my log file output the %OFFLINESYSTEMDRIVE% is pointing at C:\USMTFiles\X86, I dont know why all of a sudden it would see it as the X: ramdrive again."

    So you think %OFFLINESYSTEMDRIVE% is getting set to x: which in turn makes it go there?

    In your customsettings.ini you have it setting "UDShare=\\LONBACKUP\DeploymentShare$".  This is should not be this way.  I assume that's your deployment share.  It should be another share just for migration data. Mine is shared out on my deployment server, but it's located in it's own hidden share called migdata$.  So the full line reads like I posted above (UDShare=\\mydeploymentserver\MigData$).

    Tuesday, June 14, 2011 2:04 PM
  • I just spun up a Windows 7 x86 VM and tested my task sequence from WinPE.  I saw it create the folder \\myserver\migdata$\MININT-37BU4O1\USMT in the folder it created USMT.MIG.  So it seems to be working ok still for me.  Please address my comments above and we'll go from there.
    Tuesday, June 14, 2011 2:09 PM
  • The line you posted in your last reply is not used.  That's the disabled step that would use offline.xml.

    Yes sorry for not being clearer I obviously copied a bit too much code there!

    Also, %OFFLINESYSTEMDRIVE% should be set to c:\ and not c:\USMTFiles\x86 as you said.  %OFFLINESYSTEMDRIVE%/USMTFiles/%USMTARCH% could however be set to c:\USMTFiles\x86.  Is that what you meant to say?

    Exactly, yes this is being set to C:\USMTFiles\x86

    So you think %OFFLINESYSTEMDRIVE% is getting set to x: which in turn makes it go there?

    Well no because in the logfile it tells me that ScanState is running from C:\USMTFiles\x86 which is correct as that is where the Windows installation is, it's only after this command is executed it fails and then says "Drive X has 30MB free" I dont know how it is picking up drive X if the variable has already been set to C:\

    In your customsettings.ini you have it setting "UDShare=\\LONBACKUP\DeploymentShare$".  This is should not be this way.  I assume that's your deployment share.  It should be another share just for migration data. Mine is shared out on my deployment server, but it's located in it's own hidden share called migdata$.  So the full line reads like I posted above (UDShare=\\mydeploymentserver\MigData$).

    Yeah, my bad sorry, didn't get a coffee this morning, this has now been changed to \\lonbackup\profiles however I havent hidden the share or anything, would that make any difference.

    Thanks

    Tuesday, June 14, 2011 2:37 PM
  • I will sleep ok tonight even if you don't make it hidden.  It won't affect the functionality.  Since you changed the customsettings.ini you'll have to update your boot media before trying again.  once you do give it a shot and let me know what happens.
    Tuesday, June 14, 2011 2:44 PM
  • OK I completly updated the boot media and ran the job again.  It asks where I would like to save a full computer backup and I specified \\lonbackup\profiles (is this correct?) It starts the Task sequence and fails.

    Litetouch deployment failed, Return Code = -2147467259 0x80004005

    Message from the task sequence engine:

    Failed to run the action: Capture User State (with OfflineWinDir)

    The system cannot write to the specified device.

    Would you like me to put some of the log files here also?

    Tuesday, June 14, 2011 3:12 PM
  • Full computer backup is something else. That would capture the entire contents of c:\ and store it in a wim file. Not what you want.

    It sounds like it doesn't have permission to write to the \\lonbackup\profiles share. When you created the share did you make sure both NTFS and share permissions are set to allow the account that is running the deployment wizard? Personally I set share permissions to allow full access to the everyone group (default is everyone read only). Then I always control access by setting the NTFS permissions.  If that doesn't work we'll look at your BDD.log and USMTcapture.log.

    Tuesday, June 14, 2011 3:20 PM
  • By the way, if you search the MDT documentation it will tell you what to set the permissions to. For this particular share look for the section called "Configuring Shared Folder Permissions" under "Preparing the MDT 2010 Migration Resources".

    Tuesday, June 14, 2011 3:33 PM
  • Yes I've already made sure that the profiles directory has Everyone full access on the Share and also NTFS, so it cannot be that.  Here is the USMTCapture.log:

    2011-06-14 16:35:41, Info                  [0x000000] USMT Started at 2011/06/14:16:35:41.359

    2011-06-14 16:35:41, Info                  [0x000000] Command line: C:\USMTFiles\X86\Scanstate.exe \\LONBACKUP\Profiles\MININT-PEIH72G /v:5 /o /c /i:C:\USMTFiles\X86\MigApp.xml /i:C:\USMTFiles\X86\MigUser.xml /i:C:\USMTFiles\X86\MigDocs.xml /offlineWinDir:C:\Windows /l:C:\MININT\SMSOSD\OSDLOGS\USMTcapture.log

    2011-06-14 16:35:41, Status                [0x000000] Activity: 'MIGACTIVITY_COMMAND_LINE_PROCESSING'

    2011-06-14 16:35:41, Status                [0x000000] Activity: 'MIGACTIVITY_AUTO_GENERATE_OFFLINE_VERSION'

    2011-06-14 16:35:42, Info                  [0x000000] Drive X:\ has 30 MB free; a minimum of 250 MB is required[gle=0x000000cb]

    2011-06-14 16:35:42, Info                  [0x000000] Failed.[gle=0x00000006]

    2011-06-14 16:35:42, Info                  [0x000000]   A minimum of 250 MB of free space is required for temporary files[gle=0x00000006]

    2011-06-14 16:35:42, Info                  [0x000000] USMT Completed at 2011/06/14:16:35:42.750[gle=0x00000006]

    2011-06-14 16:35:42, Info                  [0x000000] Entering MigShutdown method

    2011-06-14 16:35:42, Info                  [0x000000] Leaving MigShutdown method

    When it fails and I load the cmd window the path reads X:\Windows\system32 - the fact that WinPE has a Windows directory, would that be getting picked up somewhere?  Just a thought.

    Tuesday, June 14, 2011 3:39 PM
  • Yeah I can write to this share because if I manually run the command after setting the USMT_WORKING_DIRECTORY=C:\ and then i run the command:

    C:\USMTFiles\X86\Scanstate.exe \\LONBACKUP\Profiles\MININT-PEIH72G /v:5 /o /c /i:C:\USMTFiles\X86\MigApp.xml /i:C:\USMTFiles\X86\MigUser.xml /i:C:\USMTFiles\X86\MigDocs.xml /offlineWinDir:C:\Windows /l:C:\MININT\SMSOSD\OSDLOGS\USMTcapture.log

    It works fine.

    Tuesday, June 14, 2011 3:51 PM
  • What's your WinPE scratch space size set to?  I increased mine to 256.  I've heard various recommendations to increase the scratch space to accomodate some video drivers which is why I increased it, but maybe it's affecting this also.  It sounds like it doesn't have enough space to execute the command on the ramdrive.

    Tuesday, June 14, 2011 4:01 PM
  • Brian, thank you very much, I changed the scratch size and kicked off the job, it seemed to be running but was taking forever, so I left the office thinking I would have come back to an error, but alas success, thanks very much for your tips!  I have another question though maybe not so troubling this time...  When the profiles are backing up it drops them to a folder called MININT-JJ5BTSC, can this not be changed so that it backs up to the actual name of the computer, or does this have to be run in an online scenario?

    Thanks again for your help, couldn't have succeeded without you!  Cheers.

    Wednesday, June 15, 2011 8:09 AM
  • No problem glad we figured it out.  As far as the computer name goes I haven't really figured a way around that.  Normally I do online migrations and plan on just doing offline in the case I can't boot the OS or possible virus activity.  Because of this I can look at my \\server\migdata$ share and easily spot the one that was done offline because it will have a randomly generated name from WinPE.  To WinPE there is no computer name assigned so it makes one up.  To get one assigned during an offline task sequence you would have to put it in a rule somewhere that would be caught during the execution of the task sequence.  With no OS actually being deployed during the offline USMT capture it would only get used to label the log folder and the USMT folder.  More headache than it was worth so I didn't bother trying to find a solution.
    Wednesday, June 15, 2011 12:45 PM
  • Hey guys,

    Sorry I have not responded. Had a lot of personal stuff going on taking up my time. Looks like you guys got your issues sorted. Glad others are finding this useful. It was a lot of work to build!!!

    Thursday, July 7, 2011 8:40 PM
  • I'm wondering if you both might be able to help me again, this time with the restore scenario?  How would I create this in MDT 2010?  Also I'm thinking I might like to be able to do the captures online as it seems easier and will capture the computername which I havent found any way around with the offline scenario.

    Is there another way to setup the task for Online?  It's a hell of a learning curve with this!  Thanks again guys...

    Monday, July 11, 2011 2:16 PM
  • Both the restore scenario and the online captures are already built in to MDT.  For the restore scenario you can specify the location of the User State files at deployment time.  There is a screen for that in the deployment wizard.  I assume you have a task sequence for "standard client task sequence" which you use to deploy your operating system?  When you boot with your deployment media and select this task sequence it will have a screen where you pick the location of the files.

    For online capture you would just create a task sequence for "Standard Client Replace Task Sequence".  It's purpose is to do an online user state capture to a location specified in the wizard and optionally do a full computer backup.  This is initiated by running litetouch.vbs from within the currently installed OS.  By default, after it's done it will reboot the computer in to WinPE and then do a full computer backup (if you chose to do so) and/or it will end the task sequence and say "operating system deployment completed succesfully" - which is a little misleading considering you didn't actually deploy an operating system in this case.

    There is certainly a learning curve with this stuff, but once you figure out the basics it's not too bad.  Once you become familiar with the tools you'll be happy you took the time to.  If you're just learning MDT there are a ton of resources available to help you learn.  There are countless videos where people go through a typical deployment (maybe too many videos).  I kind of wish we got one solid video series that goes through basic deployment scenarios.  Then rather than having the same content discussed over and over again we could maybe get some more advanced discussion.  On the other hand I did find it helpful to watch different videos from different people even though it was on the same information.  It helps drill those fundamentals in to your head and sometimes from a slightly different angle when you get a different video presenter with a different presentation.

    Johan Arwidmark also has a good fundamentals book that's like $30 on Amazon called "Deployment Fundamentals - Volume 1".  The MDT documentation in the help files is very extensive and while the information is all there the book is much easier reading for someone trying to learn.  I'm hoping Volume 2 comes out soon.


    Monday, July 11, 2011 3:33 PM
  • At the moment I have 2 working tasks, the one which you helped me create above doing the Offline capture is working well, the 2nd is a Windows 7 Image deployment using only imagex so it only has 4 steps.

    • Deployment type
    • Format & Partition Disk
    • Install Windows 7 (via imagex command line)
    • Restart Computer.

    The reasons for this sort of deployment is that another of our departments creates the wim to autologon and run certain scripts etc, I found that when I used the standard tasks it was breaking the wim file asking for license keys etc, so that is also working well.  I take it I would have to add on some steps from here to then ask for where the .mig files were located?

    I too have mountains of documentation, (like you say maybe too much!) I'll need to go back and create another task perhaps to see when it asks for the data location, it seems to be skipping that, I'll add SkipUserData=NO to the CS.ini and see where I go from there, thanks again.

    Monday, July 11, 2011 3:57 PM
  • Ah...I haven't done any custom task sequences really.  If you're just using imagex then I don't think setup.exe is being run during deployment.  I'm unsure of the downsides to this, but it makes me curious.  MDT feeds setup.exe the location of the .wim file to use for the OS in that task sequence.  If you're using volume license media then you should be able to skip the prompt for license keys.  Not sure what other things were complicating matters for you.
    Monday, July 11, 2011 5:42 PM
  • I've had a brainwave Brian, I'm going to sysprep the custom image that I was supplied tomorrow so that I can use it in a more traditional way, at the moment my overseas colleagues are using Zen to deploy this image, If I sysprep it I believe I'll be able to use it more effectively in MDT.

    Thanks.

    Monday, July 11, 2011 6:49 PM
  • Are you using MDT to create the image?  MDT should be set up to create the reference image in an automated fashion with all the latest updates and application you want to include in the image.  I would let MDT do the sysprep during the image creation.


    Monday, July 11, 2011 9:04 PM
  • As I said a colleague in another country supplied me with the Base WIM file, I am sysprepping it now to see if it is easier to use instead of having 2 seperate custom tasks.  Which is the best Task Sequenece to use after this if I want to USMT user data, deploy Windows 7 and then restore?

    Thanks again.

    Tuesday, July 12, 2011 8:52 AM
  • Oh...when you said you have overseas collegues that are using Zen to deploy the image I didn't realize they were building the image as well.  Sounds messy.

    "Which is the best Task Sequenece to use after this if I want to USMT user data"?

    This statement does not make sense.  USMT provides two functions...capture User State and apply User State.  Which are you refering to?  I think you mean capture in which case you would use the "Standard Client Replace task sequence template" to capture user state if you are replacing the computer.  Then on the new computer you would boot your MDT media and use your  "Standard Client Task sequence template".  If you aren't replacing the computer and just want to upgrade the OS then you can do a refresh.  This is performed by running litetouch.vbs from your deployment share and then selecting that same "Standard Client Task Sequence" from within the existing OS.  Since you are running it from within an existing OS it will ask you if you want to do a refresh or an upgrade.  Upgrade is not always available depending on the OS that is currently installed, but I would always choose a refresh anyhow.  That's essentially a clean install.

    Tuesday, July 12, 2011 12:57 PM
  • Yeah I meant backup user data and restore.  Basically we are doing a Windows 7 Deployment in September time, all I want to do is the following:

    • backup user data to a network share - this is working via the offline setup we talked about above, but i'd now like to do it online because I can backup to %computername% folders
    • Install Windows 7 - this is being run off and imagex command line to install the wim and that is all.
    • Restore Data - ???

    I'd love to be able to wrap these 3 up into one task but it doesnt seem possible.  I appreciate the help guys, I know you must have better things to do!


    Tuesday, July 12, 2011 3:59 PM
  • hi, have you seen this ? it offers a lot of what you are looking for (sccm w mdt integrated)

    Introducing the windows-noob.com FrontEnd HTA version 1.0
    Multipurpose HTA



    My step by step SCCM Guides
    I'm on Twitter > ncbrady
    Friday, July 29, 2011 5:00 AM
    Moderator
  • Has any one been able to integrate this into a Standard Client task sequence? What I would like to do is boot off the MDT boot disk and beadle to have one task sequence that will capture a mig file (Offline migration) then deploy the OS down and load state that migration file.

    Right now it seems you have to run two different task sequences to do this. (unless you boot into the OS and use lighttouch.vbs, but I want to do this offline)


    • Edited by PeteBC Thursday, September 29, 2011 10:29 PM
    Thursday, September 29, 2011 10:29 PM
  • PeteBC,

    If I remember right I tried doing that as well.  It turned out to be more complicated that it was worth to me at the time and I gave up.  I think all this functionality is supposed to be included in the next version of MDT which I imagine should be released any day now.  I'm a bit suprised it hasn't been released yet.

    Friday, September 30, 2011 3:19 AM
  • Brian Klish said,

    I think all this functionality is supposed to be included in the next version of MDT

    I was wrong.  I thought I heard that somewhere, but MDT 2012 was just released and the lead Developer just confirmed that functionality has not been added.  He said it’s something they’re considering for a future release.

    Wednesday, April 18, 2012 4:39 PM
  • im stil not clear on how to make this work?
    Thursday, June 28, 2012 5:03 PM
  • Can you be more specific?  What part are you stuck on?  Any errors?  Gotta give me something to work with...
    Thursday, June 28, 2012 6:25 PM
  • Hi everyone,

    I've been trying to resolve a similar problem for a while now and this post is probably the closest I've come to a solution so far.

    The aim of my project is to deploy the MDT media to a 1Tb or 2Tb USB drive with the companies standard image and four task sequences.

    TS1 - Deploy the image to a new computer (bare metal image).

    TS2 - Deploy the image to an existing computer (backup Windows XP x86 to %computername%.wim /verify and user states to the USB hard drive, deploy the image then restore the user states).

    TS3 - Backup Only (backup Windows XP x86 to %computername%.wim /verify and user states to the USB hard drive).

    TS4 - Deploy the image to a new computer with user state restore (deploy the image then restore user states backed up in TS3).

    I've got quite a lot figured out and by not setting UserDataLocation I'm able to force the backup target to a removable drive, but I need to either set the drive to a constant letter such as U: for utility or a variable and that hasn't been working for me.

    I'm also using this guide to configure the required settings for each task sequence: http://www.the-d-spot.org/wordpress/2012/07/20/how-to-use-different-settings-per-task-sequence-with-mdt-2012/

    And this one to migrate the time zone for all migrations and the computer name in TS2: http://technet.microsoft.com/en-us/library/dd252738.aspx

    Where I'm stuck at the moment is the offline.xml file and where to locate it along with the other references that need customizing in cs.ini as well as configuring the backup to usb hard drive.

    Any help would be most appreciated.

    Martyn

    Sunday, January 6, 2013 11:21 PM
  • At some point they changed the location of USMT in MDT deployment share structure.  Just make sure you update the task sequence steps to point to the new locations.  Personally I don't use the offline.xml method.  I use the /offlineWinDir option.

    I updated my task sequence and verified it works for /offlineWinDir, but the offline.xml method does not work.  Here's my ts.xml that uses the /offlineWinDir.  There's also a disabled step for offline.xml if you want to fix the command or play with that:

    <?xml version="1.0" encoding="utf-8"?>
    <sequence version="3.00" name="Custom Task Sequence" description="Sample Custom Task Sequence">
      <group name="Initialization" disable="false" continueOnError="false" description="Initialize the TS environment" expand="true">
        <step type="BDD_Gather" name="Gather local only" disable="false" continueOnError="false" successCodeList="0 3010" description="" startIn="">
          <defaultVarList>
            <variable name="GatherLocalOnly" property="GatherLocalOnly">true</variable>
            <variable name="RulesFile" property="RulesFile"></variable>
          </defaultVarList>
          <action>cscript.exe "%SCRIPTROOT%\ZTIGather.wsf"</action>
        </step>
      </group>
      <group expand="true" name="State Capture (Offline)" description="" disable="false" continueOnError="false">
        <action />
        <step type="SMS_TaskSequence_SetVariableAction" name="Set Offline System Partition (C:)" description="If a Windows folder is found at a given drive letter set %OfflineSystemDrive% to that drive letter so the USMT files and folders can be cached there." disable="false" continueOnError="false" successCodeList="0 3010">
          <defaultVarList>
            <variable name="VariableName" property="VariableName">OfflineSystemDrive</variable>
            <variable name="VariableValue" property="VariableValue">C:</variable>
          </defaultVarList>
          <action>cscript.exe "%SCRIPTROOT%\ZTISetVariable.wsf"</action>
          <condition>
            <operator type="and">
              <expression type="SMS_TaskSequence_FolderConditionExpression">
                <variable name="Path">C:\Windows</variable>
              </expression>
            </operator>
          </condition>
        </step>
        <step type="SMS_TaskSequence_SetVariableAction" name="Set Offline System Partition (D:)" description="If a Windows folder is found at a given drive letter set %OfflineSystemDrive% to that drive letter so the USMT files and folders can be cached there." disable="false" continueOnError="false" successCodeList="0 3010">
          <defaultVarList>
            <variable name="VariableName" property="VariableName">OfflineSystemDrive</variable>
            <variable name="VariableValue" property="VariableValue">D:</variable>
          </defaultVarList>
          <action>cscript.exe "%SCRIPTROOT%\ZTISetVariable.wsf"</action>
          <condition>
            <operator type="and">
              <expression type="SMS_TaskSequence_FolderConditionExpression">
                <variable name="Path">D:\Windows</variable>
              </expression>
            </operator>
          </condition>
        </step>
        <step type="SMS_TaskSequence_SetVariableAction" name="Set Offline System Partition (E:)" description="If a Windows folder is found at a given drive letter set %OfflineSystemDrive% to that drive letter so the USMT files and folders can be cached there." disable="false" continueOnError="false" successCodeList="0 3010">
          <defaultVarList>
            <variable name="VariableName" property="VariableName">OfflineSystemDrive</variable>
            <variable name="VariableValue" property="VariableValue">E:</variable>
          </defaultVarList>
          <action>cscript.exe "%SCRIPTROOT%\ZTISetVariable.wsf"</action>
          <condition>
            <operator type="and">
              <expression type="SMS_TaskSequence_FolderConditionExpression">
                <variable name="Path">E:\Windows</variable>
              </expression>
            </operator>
          </condition>
        </step>
        <step type="SMS_TaskSequence_SetVariableAction" name="Set Offline System Partition (F:)" description="If a Windows folder is found at a given drive letter set %OfflineSystemDrive% to that drive letter so the USMT files and folders can be cached there." disable="false" continueOnError="false" successCodeList="0 3010">
          <defaultVarList>
            <variable name="VariableName" property="VariableName">OfflineSystemDrive</variable>
            <variable name="VariableValue" property="VariableValue">F:</variable>
          </defaultVarList>
          <action>cscript.exe "%SCRIPTROOT%\ZTISetVariable.wsf"</action>
          <condition>
            <operator type="and">
              <expression type="SMS_TaskSequence_FolderConditionExpression">
                <variable name="Path">F:\Windows</variable>
              </expression>
            </operator>
          </condition>
        </step>
        <step type="SMS_TaskSequence_SetVariableAction" name="Set Offline System Partition (G:)" description="If a Windows folder is found at a given drive letter set %OfflineSystemDrive% to that drive letter so the USMT files and folders can be cached there." disable="false" continueOnError="false" successCodeList="0 3010">
          <defaultVarList>
            <variable name="VariableName" property="VariableName">OfflineSystemDrive</variable>
            <variable name="VariableValue" property="VariableValue">G:</variable>
          </defaultVarList>
          <action>cscript.exe "%SCRIPTROOT%\ZTISetVariable.wsf"</action>
          <condition>
            <operator type="and">
              <expression type="SMS_TaskSequence_FolderConditionExpression">
                <variable name="Path">G:\Windows</variable>
              </expression>
            </operator>
          </condition>
        </step>
        <step type="SMS_TaskSequence_SetVariableAction" name="Set USMT Platform Architecture (32-Bit)" description="Determine if the offline system is a 32-bit Windows version and set %MIG_OFFLINE_PLATFORM_ARCH% accordingly." disable="false" continueOnError="false" successCodeList="0 3010">
          <defaultVarList>
            <variable name="VariableName" property="VariableName">MIG_OFFLINE_PLATFORM_ARCH</variable>
            <variable name="VariableValue" property="VariableValue">32</variable>
          </defaultVarList>
          <action>cscript.exe "%SCRIPTROOT%\ZTISetVariable.wsf"</action>
          <condition>
            <operator type="not">
              <expression type="SMS_TaskSequence_FolderConditionExpression">
                <variable name="Path">%OFFLINESYSTEMDRIVE%\Program Files (x86)</variable>
              </expression>
              <expression type="SMS_TaskSequence_FolderConditionExpression">
                <variable name="Path">%OFFLINESYSTEMDRIVE%\Windows\SysWOW64</variable>
              </expression>
            </operator>
          </condition>
        </step>
        <step type="SMS_TaskSequence_SetVariableAction" name="Set USMT Platform Architecture (64-Bit)" description="Determine if the offline system is a 64-bit Windows version and set %MIG_OFFLINE_PLATFORM_ARCH% accordingly." disable="false" continueOnError="false" successCodeList="0 3010">
          <defaultVarList>
            <variable name="VariableName" property="VariableName">MIG_OFFLINE_PLATFORM_ARCH</variable>
            <variable name="VariableValue" property="VariableValue">64</variable>
          </defaultVarList>
          <action>cscript.exe "%SCRIPTROOT%\ZTISetVariable.wsf"</action>
          <condition>
            <operator type="and">
              <expression type="SMS_TaskSequence_FolderConditionExpression">
                <variable name="Path">%OFFLINESYSTEMDRIVE%\Program Files (x86)</variable>
              </expression>
              <expression type="SMS_TaskSequence_FolderConditionExpression">
                <variable name="Path">%OFFLINESYSTEMDRIVE%\Windows\SysWOW64</variable>
              </expression>
            </operator>
          </condition>
        </step>
        <step type="SMS_TaskSequence_SetVariableAction" name="Set State Store Location" description="Set %OSDStateStorePath% to %UDShare%\%UDDir% so path names can be controlled by CS.ini (this will store migration data created by scanstate.exe)." disable="false" continueOnError="false" successCodeList="0 3010">
          <defaultVarList>
            <variable name="VariableName" property="VariableName">OSDStateStorePath</variable>
            <variable name="VariableValue" property="VariableValue">%UDShare%\%HostName%</variable>
          </defaultVarList>
          <action>cscript.exe "%SCRIPTROOT%\ZTISetVariable.wsf"</action>
        </step>
        <step type="SMS_TaskSequence_RunCommandLineAction" name="Create State Store Location" description="If it does not already exist create a folder to store the user state migration files generated by scanstate.exe." disable="false" continueOnError="false" startIn="" successCodeList="0 3010" runIn="WinPEandFullOS">
          <defaultVarList>
            <variable name="PackageID" property="PackageID"></variable>
            <variable name="RunAsUser" property="RunAsUser">false</variable>
            <variable name="SMSTSRunCommandLineUserName" property="SMSTSRunCommandLineUserName"></variable>
            <variable name="SMSTSRunCommandLineUserPassword" property="SMSTSRunCommandLineUserPassword"></variable>
            <variable name="LoadProfile" property="LoadProfile">false</variable>
          </defaultVarList>
          <action>cmd.exe /c if not exist "%OSDSTATESTOREPATH%" md "%OSDSTATESTOREPATH%"</action>
        </step>
        <step type="SMS_TaskSequence_RunCommandLineAction" name="Cache USMT Files and Scripts" description="Copy the USMT component files and scripts to a temporary location on the offline system partition." disable="false" continueOnError="false" startIn="" successCodeList="0 3010" runIn="WinPEandFullOS">
          <defaultVarList>
            <variable name="PackageID" property="PackageID"></variable>
            <variable name="RunAsUser" property="RunAsUser">false</variable>
            <variable name="SMSTSRunCommandLineUserName" property="SMSTSRunCommandLineUserName"></variable>
            <variable name="SMSTSRunCommandLineUserPassword" property="SMSTSRunCommandLineUserPassword"></variable>
            <variable name="LoadProfile" property="LoadProfile">false</variable>
          </defaultVarList>
          <action>xcopy "%DEPLOYROOT%\Tools\%ARCHITECTURE%\USMT4\*" "%OFFLINESYSTEMDRIVE%\USMTFiles\%ARCHITECTURE%" /herciy</action>
        </step>
        <step type="SMS_TaskSequence_SetVariableAction" name="Set USMT Working Directory" description="Set the USMT working directory variable to the offline system partition (ex c:\temp)" disable="false" continueOnError="false" successCodeList="0 3010">
          <defaultVarList>
            <variable name="VariableName" property="VariableName">USMT_WORKING_DIR</variable>
            <variable name="VariableValue" property="VariableValue">%OFFLINESYSTEMDRIVE%\temp</variable>
          </defaultVarList>
          <action>cscript.exe "%SCRIPTROOT%\ZTISetVariable.wsf"</action>
        </step>
        <step type="SMS_TaskSequence_RunCommandLineAction" name="Capture User State (with OfflineWinDir)" description="Perform offline USMT capture by running scanstate.exe commands with variables set by this task sequence and USMT-specific variables in CS.ini." disable="false" continueOnError="false" startIn="" successCodeList="0 3010" runIn="WinPEandFullOS">
          <defaultVarList>
            <variable name="PackageID" property="PackageID"></variable>
            <variable name="RunAsUser" property="RunAsUser">false</variable>
            <variable name="SMSTSRunCommandLineUserName" property="SMSTSRunCommandLineUserName"></variable>
            <variable name="SMSTSRunCommandLineUserPassword" property="SMSTSRunCommandLineUserPassword"></variable>
            <variable name="LoadProfile" property="LoadProfile">false</variable>
          </defaultVarList>
          <action>"%OFFLINESYSTEMDRIVE%\USMTFiles\%ARCHITECTURE%\Scanstate.exe" "%OSDStateStorePath%" %SCANSTATEARGS% /i:"%OFFLINESYSTEMDRIVE%\USMTFiles\%ARCHITECTURE%\MigApp.xml" /i:"%OFFLINESYSTEMDRIVE%\USMTFiles\%ARCHITECTURE%\MigUser.xml" /i:"%OFFLINESYSTEMDRIVE%\USMTFiles\%ARCHITECTURE%\MigDocs.xml" /offlineWinDir:"%OfflineSystemDrive%\Windows" /l:"%OFFLINESYSTEMDRIVE%\MININT\SMSOSD\OSDLOGS\USMTcapture.log"</action>
        </step>
        <step type="SMS_TaskSequence_RunCommandLineAction" name="Capture User State (with Offline.xml)" description="Perform offline USMT capture by running scanstate.exe commands with variables set by this task sequence and USMT-specific variables in CS.ini." disable="true" continueOnError="false" startIn="" successCodeList="0 3010" runIn="WinPEandFullOS">
          <defaultVarList>
            <variable name="PackageID" property="PackageID" />
            <variable name="RunAsUser" property="RunAsUser">false</variable>
            <variable name="SMSTSRunCommandLineUserName" property="SMSTSRunCommandLineUserName"></variable>
            <variable name="SMSTSRunCommandLineUserPassword" property="SMSTSRunCommandLineUserPassword"></variable>
            <variable name="LoadProfile" property="LoadProfile">false</variable>
          </defaultVarList>
          <action>"%OFFLINESYSTEMDRIVE%\USMTFiles\%USMTARCH%\Scanstate.exe" "%OSDSTATESTOREPATH%" %SCANSTATEARGS% /i:"%OFFLINESYSTEMDRIVE%\USMTFiles\%USMTARCH%\MigApp.xml" /i:"%OFFLINESYSTEMDRIVE%\USMTFiles\%USMTARCH%\MigUser.xml" /i:"%OFFLINESYSTEMDRIVE%\USMTFiles\%USMTARCH%\MigCustomData.xml" /config:"%OFFLINESYSTEMDRIVE%\USMTFiles\%USMTARCH%\MigCustomConfig.xml" /offline:"%OFFLINESYSTEMDRIVE%\USMTFiles\%USMTARCH%\Offline.xml" /l:"%OFFLINESYSTEMDRIVE%\MININT\SMSOSD\OSDLOGS\USMTcapture.log" /progress:"%OFFLINESYSTEMDRIVE%\MININT\SMSOSD\OSDLOGS\USMTcapture.prg"</action>
        </step>
        <step type="SMS_TaskSequence_RunCommandLineAction" name="Clean Up USMT Files and Scripts" description="Remove any remaining temporary USMT component files and scripts from the offline system partition." disable="false" continueOnError="false" startIn="" successCodeList="0 3010" runIn="WinPEandFullOS">
          <defaultVarList>
            <variable name="PackageID" property="PackageID"></variable>
            <variable name="RunAsUser" property="RunAsUser">false</variable>
            <variable name="SMSTSRunCommandLineUserName" property="SMSTSRunCommandLineUserName"></variable>
            <variable name="SMSTSRunCommandLineUserPassword" property="SMSTSRunCommandLineUserPassword"></variable>
            <variable name="LoadProfile" property="LoadProfile">false</variable>
          </defaultVarList>
          <action>cmd.exe /c rd "%OFFLINESYSTEMDRIVE%\USMTFiles" /s /q</action>
        </step>
      </group>
    </sequence>

    Thursday, February 14, 2013 8:40 PM
  • Wow Brian, I'm amazed that you are still maintaining this! Glad to see this has proven useful to a lot fo people. I'm actually in the process of upgrading my helpdesk team to MDT 2012 so I'll try your revised TS out! 
    Thursday, March 7, 2013 4:38 PM
  • Brian now that MDT has been upgraded again. 
    Can MDT do the user back up and restore without running vbs scripts in the OS.
    everything from the MDT GUI.  I'm basically trying to create point and click just like reimaging but include user back up. so anyone can do it.
    We don't care about anything but files really

    This is our scenario,
    We basically just build new machines because PC needs to be replaced (old) or OS has crashed.  
    PXE boot back up files to share. Get new PC pxe boot that start OS reimage and restore user files. Why is this so difficult. 

    I have been researching and researching (also everything on this was written in 2010-2011 that was 8 years ago)
    MDT asks to back up the user state and it asks if you want to restore but I have not gotten this to work.
    Every thing i read on offline backup says remove the HD from the bad machine or run a vbs script on the old PC to start USMT.

     
    Tuesday, February 27, 2018 1:50 PM
  • This process should still work and what you are explaining should be possible. Can you explain what isn't working for you?  Are you having issues creating the offline backup or do you get past that part?
    Tuesday, February 27, 2018 4:36 PM
  • Let me say thank you in advance. Seems very few people know how to do this in this way.

    I have made one back up from a laptop i had sitting around
    But getting that back up to another machine was a different story.  the reload of the OS completed but it never moved the files.  Also the new build machine is not on the domain, if that matters

    My configs could be completely wrong. 
    Could you point me or let me know the correct way to accomplish this, or the best practice way.
    After everything I have read i'm really lost now. Most people do not know how to do it this way

    Looking for the simplest way to
    PXE boot PC
    start MDT select back up user state. is shows the share path
    back up the files, 
    complete

    PXE Boot next PC 
    select TS with user back up restore
    select options, apps etc
    start imaging PC

    Tuesday, February 27, 2018 9:27 PM
  • If you create a new custom task sequence in MDT it will go in the folder \\myserver\myshare\Control\TaskSequenceName. I updated my task sequence to support USMT 5 so it's a bit different from what I posted previously.  If you copy the below xml to a text file and save it as "ts.xml" and save it in \\myserver\myshare\Control\TaskSequenceName replacing the existing "ts.xml" that you created then you will have the task sequence I use for an offline capture.  That being said I rarely run it as I always try to get an online capture if possible since that gets more data.  I run this as a last resort.

    Once you create the task sequence boot your machine to WinPE using your boot media and run the new task sequence.  It will not prompt you for computer name though.  I believe it uses the temp computer name that WinPE assigns and then I typically rename it manually after it's done.  I don't have time to test it tonight to confirm, but this should get you started.

    <?xml version="1.0"?>
    <sequence version="3.00" name="Custom Task Sequence" description="Sample Custom Task Sequence">
      <group name="Initialization" disable="false" continueOnError="false" description="Initialize the TS environment" expand="true">
        <step type="BDD_Gather" name="Gather local only" disable="false" continueOnError="false" successCodeList="0 3010" description="" startIn="">
          <defaultVarList>
            <variable name="GatherLocalOnly" property="GatherLocalOnly">true</variable>
            <variable name="RulesFile" property="RulesFile"></variable>
          </defaultVarList>
          <action>cscript.exe "%SCRIPTROOT%\ZTIGather.wsf"</action>
        </step>
      </group>
      <group expand="true" name="State Capture (Offline)" description="" disable="false" continueOnError="false">
        <action />
        <step type="SMS_TaskSequence_SetVariableAction" name="Set Offline System Partition (C:)" description="If a Windows folder is found at a given drive letter set %OfflineSystemDrive% to that drive letter so the USMT files and folders can be cached there." disable="false" continueOnError="false" successCodeList="0 3010">
          <defaultVarList>
            <variable name="VariableName" property="VariableName">OfflineSystemDrive</variable>
            <variable name="VariableValue" property="VariableValue">C:</variable>
          </defaultVarList>
          <action>cscript.exe "%SCRIPTROOT%\ZTISetVariable.wsf"</action>
          <condition>
            <operator type="and">
              <expression type="SMS_TaskSequence_FolderConditionExpression">
                <variable name="Path">C:\Windows</variable>
              </expression>
            </operator>
          </condition>
        </step>
        <step type="SMS_TaskSequence_SetVariableAction" name="Set Offline System Partition (D:)" description="If a Windows folder is found at a given drive letter set %OfflineSystemDrive% to that drive letter so the USMT files and folders can be cached there." disable="false" continueOnError="false" successCodeList="0 3010">
          <defaultVarList>
            <variable name="VariableName" property="VariableName">OfflineSystemDrive</variable>
            <variable name="VariableValue" property="VariableValue">D:</variable>
          </defaultVarList>
          <action>cscript.exe "%SCRIPTROOT%\ZTISetVariable.wsf"</action>
          <condition>
            <operator type="and">
              <expression type="SMS_TaskSequence_FolderConditionExpression">
                <variable name="Path">D:\Windows</variable>
              </expression>
            </operator>
          </condition>
        </step>
        <step type="SMS_TaskSequence_SetVariableAction" name="Set Offline System Partition (E:)" description="If a Windows folder is found at a given drive letter set %OfflineSystemDrive% to that drive letter so the USMT files and folders can be cached there." disable="false" continueOnError="false" successCodeList="0 3010">
          <defaultVarList>
            <variable name="VariableName" property="VariableName">OfflineSystemDrive</variable>
            <variable name="VariableValue" property="VariableValue">E:</variable>
          </defaultVarList>
          <action>cscript.exe "%SCRIPTROOT%\ZTISetVariable.wsf"</action>
          <condition>
            <operator type="and">
              <expression type="SMS_TaskSequence_FolderConditionExpression">
                <variable name="Path">E:\Windows</variable>
              </expression>
            </operator>
          </condition>
        </step>
        <step type="SMS_TaskSequence_SetVariableAction" name="Set Offline System Partition (F:)" description="If a Windows folder is found at a given drive letter set %OfflineSystemDrive% to that drive letter so the USMT files and folders can be cached there." disable="false" continueOnError="false" successCodeList="0 3010">
          <defaultVarList>
            <variable name="VariableName" property="VariableName">OfflineSystemDrive</variable>
            <variable name="VariableValue" property="VariableValue">F:</variable>
          </defaultVarList>
          <action>cscript.exe "%SCRIPTROOT%\ZTISetVariable.wsf"</action>
          <condition>
            <operator type="and">
              <expression type="SMS_TaskSequence_FolderConditionExpression">
                <variable name="Path">F:\Windows</variable>
              </expression>
            </operator>
          </condition>
        </step>
        <step type="SMS_TaskSequence_SetVariableAction" name="Set Offline System Partition (G:)" description="If a Windows folder is found at a given drive letter set %OfflineSystemDrive% to that drive letter so the USMT files and folders can be cached there." disable="false" continueOnError="false" successCodeList="0 3010">
          <defaultVarList>
            <variable name="VariableName" property="VariableName">OfflineSystemDrive</variable>
            <variable name="VariableValue" property="VariableValue">G:</variable>
          </defaultVarList>
          <action>cscript.exe "%SCRIPTROOT%\ZTISetVariable.wsf"</action>
          <condition>
            <operator type="and">
              <expression type="SMS_TaskSequence_FolderConditionExpression">
                <variable name="Path">G:\Windows</variable>
              </expression>
            </operator>
          </condition>
        </step>
        <step type="SMS_TaskSequence_SetVariableAction" name="Set USMT Platform Architecture (32-Bit)" description="Determine if the offline system is a 32-bit Windows version and set %MIG_OFFLINE_PLATFORM_ARCH% accordingly." disable="false" continueOnError="false" successCodeList="0 3010">
          <defaultVarList>
            <variable name="VariableName" property="VariableName">MIG_OFFLINE_PLATFORM_ARCH</variable>
            <variable name="VariableValue" property="VariableValue">32</variable>
          </defaultVarList>
          <action>cscript.exe "%SCRIPTROOT%\ZTISetVariable.wsf"</action>
          <condition>
            <operator type="not">
              <expression type="SMS_TaskSequence_FolderConditionExpression">
                <variable name="Path">%OFFLINESYSTEMDRIVE%\Program Files (x86)</variable>
              </expression>
              <expression type="SMS_TaskSequence_FolderConditionExpression">
                <variable name="Path">%OFFLINESYSTEMDRIVE%\Windows\SysWOW64</variable>
              </expression>
            </operator>
          </condition>
        </step>
        <step type="SMS_TaskSequence_SetVariableAction" name="Set USMT Platform Architecture (64-Bit)" description="Determine if the offline system is a 64-bit Windows version and set %MIG_OFFLINE_PLATFORM_ARCH% accordingly." disable="false" continueOnError="false" successCodeList="0 3010">
          <defaultVarList>
            <variable name="VariableName" property="VariableName">MIG_OFFLINE_PLATFORM_ARCH</variable>
            <variable name="VariableValue" property="VariableValue">64</variable>
          </defaultVarList>
          <action>cscript.exe "%SCRIPTROOT%\ZTISetVariable.wsf"</action>
          <condition>
            <operator type="and">
              <expression type="SMS_TaskSequence_FolderConditionExpression">
                <variable name="Path">%OFFLINESYSTEMDRIVE%\Program Files (x86)</variable>
              </expression>
              <expression type="SMS_TaskSequence_FolderConditionExpression">
                <variable name="Path">%OFFLINESYSTEMDRIVE%\Windows\SysWOW64</variable>
              </expression>
            </operator>
          </condition>
        </step>
        <step type="SMS_TaskSequence_SetVariableAction" name="Set State Store Location" description="Set %OSDStateStorePath% to %UDShare%\%UDDir% so path names can be controlled by CS.ini (this will store migration data created by scanstate.exe)." disable="false" continueOnError="false" successCodeList="0 3010">
          <defaultVarList>
            <variable name="VariableName" property="VariableName">OSDStateStorePath</variable>
            <variable name="VariableValue" property="VariableValue">%UDShare%\%HostName%</variable>
          </defaultVarList>
          <action>cscript.exe "%SCRIPTROOT%\ZTISetVariable.wsf"</action>
        </step>
        <step type="SMS_TaskSequence_RunCommandLineAction" name="Create State Store Location" description="If it does not already exist create a folder to store the user state migration files generated by scanstate.exe." disable="false" continueOnError="false" startIn="" successCodeList="0 3010" runIn="WinPEandFullOS">
          <defaultVarList>
            <variable name="PackageID" property="PackageID" />
            <variable name="RunAsUser" property="RunAsUser">false</variable>
            <variable name="SMSTSRunCommandLineUserName" property="SMSTSRunCommandLineUserName"></variable>
            <variable name="SMSTSRunCommandLineUserPassword" property="SMSTSRunCommandLineUserPassword"></variable>
            <variable name="LoadProfile" property="LoadProfile">false</variable>
          </defaultVarList>
          <action>cmd.exe /c if not exist "%OSDSTATESTOREPATH%" md "%OSDSTATESTOREPATH%"</action>
        </step>
        <step type="SMS_TaskSequence_RunCommandLineAction" name="Cache USMT Files and Scripts" description="Copy the USMT component files and scripts to a temporary location on the offline system partition." disable="false" continueOnError="false" startIn="" successCodeList="0 3010" runIn="WinPEandFullOS">
          <defaultVarList>
            <variable name="PackageID" property="PackageID" />
            <variable name="RunAsUser" property="RunAsUser">false</variable>
            <variable name="SMSTSRunCommandLineUserName" property="SMSTSRunCommandLineUserName"></variable>
            <variable name="SMSTSRunCommandLineUserPassword" property="SMSTSRunCommandLineUserPassword"></variable>
            <variable name="LoadProfile" property="LoadProfile">false</variable>
          </defaultVarList>
          <action>xcopy "%DEPLOYROOT%\Tools\%ARCHITECTURE%\USMT5\*" "%OFFLINESYSTEMDRIVE%\USMTFiles\%ARCHITECTURE%" /herciy</action>
        </step>
        <step type="SMS_TaskSequence_SetVariableAction" name="Set USMT Working Directory" description="Set the USMT working directory variable to the offline system partition (ex c:\temp)" disable="false" continueOnError="false" successCodeList="0 3010">
          <defaultVarList>
            <variable name="VariableName" property="VariableName">USMT_WORKING_DIR</variable>
            <variable name="VariableValue" property="VariableValue">%OFFLINESYSTEMDRIVE%\temp</variable>
          </defaultVarList>
          <action>cscript.exe "%SCRIPTROOT%\ZTISetVariable.wsf"</action>
        </step>
        <step type="BDD_RunPowerShellAction" name="Log all variables" description="" disable="true" continueOnError="false" successCodeList="0 3010">
          <defaultVarList>
            <variable name="ScriptName" property="ScriptName">%DEPLOYROOT%\MAC-IT-CustomScripts\LogMDTvariables.ps1</variable>
            <variable name="Parameters" property="Parameters"></variable>
            <variable name="PackageID" property="PackageID" />
          </defaultVarList>
          <action>cscript.exe "%SCRIPTROOT%\ZTIPowerShell.wsf</action>
        </step>
        <step type="SMS_TaskSequence_RunCommandLineAction" name="Capture User State (with OfflineWinDir)" description="Perform offline USMT capture by running scanstate.exe commands with variables set by this task sequence and USMT-specific variables in CS.ini." disable="false" continueOnError="false" startIn="" successCodeList="0 3010" runIn="WinPEandFullOS">
          <defaultVarList>
            <variable name="PackageID" property="PackageID" />
            <variable name="RunAsUser" property="RunAsUser">false</variable>
            <variable name="SMSTSRunCommandLineUserName" property="SMSTSRunCommandLineUserName"></variable>
            <variable name="SMSTSRunCommandLineUserPassword" property="SMSTSRunCommandLineUserPassword"></variable>
            <variable name="LoadProfile" property="LoadProfile">false</variable>
          </defaultVarList>
          <action>"%OFFLINESYSTEMDRIVE%\USMTFiles\%ARCHITECTURE%\Scanstate.exe" "%OSDStateStorePath%" %SCANSTATEARGS% /i:"%OFFLINESYSTEMDRIVE%\USMTFiles\%ARCHITECTURE%\MigApp.xml" /i:"%OFFLINESYSTEMDRIVE%\USMTFiles\%ARCHITECTURE%\MigDocs.xml" /offlineWinDir:"%OfflineSystemDrive%\Windows" /l:"%OFFLINESYSTEMDRIVE%\MININT\SMSOSD\OSDLOGS\USMTcapture.log"</action>
        </step>
        <step type="SMS_TaskSequence_RunCommandLineAction" name="Capture User State (with Offline.xml)" description="Perform offline USMT capture by running scanstate.exe commands with variables set by this task sequence and USMT-specific variables in CS.ini." disable="true" continueOnError="false" startIn="" successCodeList="0 3010" runIn="WinPEandFullOS">
          <defaultVarList>
            <variable name="PackageID" property="PackageID" />
            <variable name="RunAsUser" property="RunAsUser">false</variable>
            <variable name="SMSTSRunCommandLineUserName" property="SMSTSRunCommandLineUserName"></variable>
            <variable name="SMSTSRunCommandLineUserPassword" property="SMSTSRunCommandLineUserPassword"></variable>
            <variable name="LoadProfile" property="LoadProfile">false</variable>
          </defaultVarList>
          <action>"%OFFLINESYSTEMDRIVE%\USMTFiles\%USMTARCH%\Scanstate.exe" "%OSDSTATESTOREPATH%" %SCANSTATEARGS% /i:"%OFFLINESYSTEMDRIVE%\USMTFiles\%USMTARCH%\MigApp.xml" /i:"%OFFLINESYSTEMDRIVE%\USMTFiles\%USMTARCH%\MigUser.xml" /i:"%OFFLINESYSTEMDRIVE%\USMTFiles\%USMTARCH%\MigCustomData.xml" /config:"%OFFLINESYSTEMDRIVE%\USMTFiles\%USMTARCH%\MigCustomConfig.xml" /offline:"%OFFLINESYSTEMDRIVE%\USMTFiles\%USMTARCH%\Offline.xml" /l:"%OFFLINESYSTEMDRIVE%\MININT\SMSOSD\OSDLOGS\USMTcapture.log" /progress:"%OFFLINESYSTEMDRIVE%\MININT\SMSOSD\OSDLOGS\USMTcapture.prg"</action>
        </step>
        <step type="SMS_TaskSequence_RunCommandLineAction" name="Clean Up USMT Files and Scripts" description="Remove any remaining temporary USMT component files and scripts from the offline system partition." disable="false" continueOnError="false" startIn="" successCodeList="0 3010" runIn="WinPEandFullOS">
          <defaultVarList>
            <variable name="PackageID" property="PackageID" />
            <variable name="RunAsUser" property="RunAsUser">false</variable>
            <variable name="SMSTSRunCommandLineUserName" property="SMSTSRunCommandLineUserName"></variable>
            <variable name="SMSTSRunCommandLineUserPassword" property="SMSTSRunCommandLineUserPassword"></variable>
            <variable name="LoadProfile" property="LoadProfile">false</variable>
          </defaultVarList>
          <action>cmd.exe /c rd "%OFFLINESYSTEMDRIVE%\USMTFiles" /s /q</action>
        </step>
      </group>
    </sequence>

    Wednesday, February 28, 2018 3:06 AM