How to use USMT 4 hardlinking in a Configuration Manager 2007 Task Sequence

How to use USMT 4 hardlinking in a Configuration Manager 2007 Task Sequence

  • Comments 19
  • Likes

image Suppose you want to use the USMT 4 feature of hardlinking in a System Center Configuration Manager 2007 Task Sequence, but you notice that the "Capture User State"/"Capture User Files and Settings" and "Restore User State"/"Restore User Files and Settings" tasks do not have any options to perform a local capture with hardlinking.  What's up with that?

Well what's going on is that USMT 4, which introduced hardlinking, shipped after ConfigMgr 2007 so the hardlinking option was not available in ConfigMgr 2007. However, USMT 4 support was added in ConfigMgr 2007 SP2, and via the OSDMigrateAdditionalCaptureOptions and OSDMigrateAdditionalRestoreOptions variables, a hardlink user migration can be accomplished in a ConfigMgr 2007 SP2 Task Sequence.

Out of the box, ConfigMgr 2007 SP2 only supports USMT 4 online captures, or captures that take place while in the full Windows OS. ConfigMgr 2007 SP2 does not support USMT 4 offline captures, or captures that take place while in WinPE. Offline captures are possible using the UDI feature of MDT 2010 Update 1 when it is integrated with ConfigMgr 2007 SP2.

With that said, there are several ways that a USMT 4 hardlink migration can be accomplished in a ConfigMgr 2007 Task Sequence, including:

  1. Create a new ConfigMgr 2007 Task Sequence that supports USMT 4 hardlinking.
  2. Modify an existing ConfigMgr 2007 Task Sequence that have the "Capture User State" and "Restore User State" tasks to support USMT 4 hardlinking.

Since USMT 4 support was not added until SP2 of ConfigMgr 2007, SP2 of ConfigMgr 2007 is required for hardlinking.

USMT 4 is supported in the following refresh scenarios:

  • Windows XP --> Windows Vista
  • Windows XP --> Windows 7
  • Windows Vista --> Windows Vista
  • Windows Vista --> Windows 7
  • Windows 7 --> Windows 7

USMT 4 is not supported for Windows XP --> Windows XP scenarios.

The first step is to ensure that the USMT 4 package is created:

Create the USMT 4 Package

When ConfigMgr 2007 SP2 is installed on the site server, the Windows Automated Installation Kit 2.0 (WAIK 2.0) is automatically installed. USMT 4 is part of WAIK 2.0 and its binaries can be found within the WAIK 2.0 installation folder.

  1. In the ConfigMgr 2007 Admin console on the site server, navigate to the "Computer Management" --> "Software Distribution" --> "Packages" node.
  2. Right click on the "Packages" node and select "New" --> "Package".
  3. In the "General" window, fill out the appropriate fields. The name of the package should describe it as the USMT 4 package. Click on the "Next >" button.
  4. In the "Date Source" window:
    • Check the option "This package contains source files"
    • Click on the "Set..." button under "Source directory".
      • Click on the option "Local drive on site server"
      • Click on the "Browse..." button under "Source directory: "
      • Navigate to and select C:\Program Files\Windows AIK\Tools\USMT folder and click on the "OK" button. Make sure to select the root of the USMT folder. DO NOT directly select either the amd64 or x86 folders. When running, the Task Sequence will automatically choose the appropriate binaries.
    • Click on the "OK" button.
    • Click on the "Next >" button.
  5. In the "Data Access" window, click on the "Next >" button.
  6. In the "Distribution Settings" window, click on the "Next >" button.
  7. In the "Reporting" window, click on the "Next >" button.
  8. In the "Security" window, click on the "Next >" button.
  9. In the "Summary" window, click on the "Next >" button.
  10. In the "Wizard Complete" window, click on the "Close" button.
  11. In the ConfigMgr 2007 Admin console, navigate to the "Computer Management" --> "Software Distribution" --> "Packages" node and find the newly created USMT 4 package.
  12. Expand the USMT 4 package and then right click on "Distribution Points" and select "New Distribution Points".
  13. Go through the "New Distribution Points Wizard" and make sure that the USMT 4 package is placed on some Distribution Points.

Notes:

  • It is not required to create a Program as part of the USMT 4 package.
  • In Step 5, if the WAIK 2.0 is installed on a different drive or directory, make sure to adjust the path C:\Program Files\Windows AIK\Tools\USMT accordingly.
  • It is recommended that the above steps be taken in a ConfigMgr 2007 console running on the site server where the WAIK 2.0 is installed. However, the above steps can be taken in a ConfigMgr 2007 admin console that is not running on the site server. In Step 5 , instead of selecting the option "Local drive on site server", select the option "Network path (UNC name)" and browse to a network share that has the WAIK 2.0 installed or the USMT 4 binary source files.
  • Please remember that the USMT 4 source files should contain BOTH the amd64 and x86 directories. The package should point to the root of the USMT 4 directory. It should NOT point directly to either the amd64 and x86 directories.

After creating the USMT 4 package, select the method below to enable USMT 4 hardlinking in a Task Sequence.

Method 1: Create a new ConfigMgr 2007 Task Sequence that supports USMT 4 hardlinking

  1. In the ConfigMgr 2007 Admin console, navigate to the "Computer Management" --> "Operating System Deployment" --> "Task Sequences" node.
  2. Right click on the "Task Sequences" node and choose "New" --> "Task Sequence".
  3. In the "Create a New Task Sequence" window, select the option "Install an existing image package" and click on the "Next >" button.
  4. In the "Task Sequence Information" window:
    • Next to "Task Sequence name:" text box, give the Task Sequence the desired name.
    • Click on the "Browse..." button next to "Boot Image:" and choose an appropriate Boot Image.
    • Click on the "Next >" button.
  5. In the "Install the Windows Operating System" window:
    • Click on the "Browse..." button next to "Image package:" and select the Operating System Image that is desired to be deployed.
    • Next to the "Image:" drop down box, make sure the desired image is selected.
    • UNCHECK the option "Partition and format the target computer before installing the operating system".
    • If desired, enter the product key next to the "Product Key:" text box.  If using a KMS activation server, this field should be left blank when deploying Windows Vista or Windows 7.
    • If desired, select the option "Always use the same administrator password" and specify the password in the "Password:" and "Confirm password:" text boxes.
    • Click on the "Next >" button.
  6. In the "Configure the Network" window, select "Join a domain" and fill out the appropriate fields. Click on the "Next >" button.
  7. In the "Install the ConfigMgr client" window, click on the "Browse" button and choose a package that contains the ConfigMgr 2007 SP2 install files. Make sure that the package is an SP2 installer of the ConfigMgr 2007 client. Selecting a package that contains either the RTM or SP1 client install files will cause the "Restore User State" task to fail since clients that are not SP2 do not support USMT 4. Click on the "Next >" button.
  8. In the "Configure State Migration" window:
    • Click on the "Browse..." button next to the "USMT Package:" field. Select the USMT 4 package and then click on the "OK" button.
    • Select the option "Save user settings locally". If this option is grayed out, the option "Partition and format the target computer before installing the operating system" was not unchecked in Step 5.
    • If desired, leave the options "Capture network settings" and "Capture Microsoft Windows settings" checked.
    • Click on the "Next >" button.
  9. In the "Include Updates in Image" window, select whether or not to install updates during the Task Sequence, and then click on the "Next >" button.
  10. In the "Install Software Packages" window, add any packages that are desired to be installed during the Task Sequence, and then click on the "Next >" button.
  11. In the "Summary" window, click on the "Next >" button.
  12. In the "Wizard Complete" window, click on the "Close" button.
  13. In the ConfigMgr 2007 Admin console, navigate to the "Computer Management" --> "Operating System Deployment" --> "Task Sequences" node.
  14. Right click on the newly created Task Sequence and choose "Edit".
  15. Click on the "Set Local State Location" task. Next to the "Value:" text field, change it from %_SMSTSUserStatePath% to %SystemDrive%\UserState.
  16. Make sure that the "Set Local State Location" task is still selected and go to "Add" --> "General" --> "Set Task Sequence Variable". This should create a "Set Task Sequence Variable" task in after the "Set Local State Location" and before "Capture User Files and Settings" tasks.
  17. In the newly created "Set Task Sequence Variable Task":
    • Next to the "Name:" text box, enter in:
      Set USMT Additional Capture Options
    • Next to the "Task Sequence Variable:" text box, enter in:
      OSDMigrateAdditionalCaptureOptions
    • Next to the "Value:" text box, enter in:
      /nocompress /hardlink
  18. Click on the "Capture User Files and Settings" task to select it:
    • Check the option "Enable verbose logging"
    • Click on the "Options" tab and then uncheck the option "Continue on error".
  19. Click on the "Restore User Files and Settings" task and then go to "Add" --> "General" --> "Set Task Sequence Variable". This should create a "Set Task Sequence Variable" task after the "Restore User Files and Settings" group and before the "Restore User Files and Settings" task.
  20. In the newly created "Set Task Sequence Variable Task":
    • Next to the "Name: " text box, enter in:
      Set USMT Additional Restore Options
    • Next to the "Task Sequence Variable:" text box, enter in:
      OSDMigrateAdditionalRestoreOptions
    • Next to the "Value:" text box, enter in:
      /nocompress /hardlink
  21. Click on the "Restore User Files and Settings" task to select it and then click on the option "Enable verbose logging".
  22. Click on the "OK" or "Apply" button to save the task sequence.

Please make sure to look at the notes section at the end of this post for detailed explanations on some of the above actions.

Method 2: Modify an existing ConfigMgr 2007 Task Sequence that has the "Capture User State" and "Restore User State" tasks in it

 

 

If a ConfigMgr 2007 Task Sequence that was used with USMT 3 or USMT 4 exists and was setup for either network capture with a State Migration Point (SMP) or for local capture on the hard drive without hardlinking, it can be modified to support USMT 4 local capture with hard linking.

 

The below instructions assume that there is already a "Capture User State"/"Capture User Files and Settings" and "Restore User State"/"Restore User Files and Settings" tasks in the appropriate spots in the Task Sequence. If these tasks do no already exist in the Task Sequence, it is recommended to create a new Task Sequence using the method detailed above.

The below instructions are also not valid for a ConfigMgr 2007 Task Sequence that was created using the MDT 2010/MDT 2010 Update 1 "Create Microsoft Deployment Task Sequence" Wizard. Please see the section "More Information" for additional information regarding Task Sequences created using the MDT 2010/MDT 2010 Update 1 "Create Microsoft Deployment Task Sequence" Wizard:

  1. In the ConfigMgr 2007 Admin console, navigate to the "Computer Management" --> "Operating System Deployment" --> "Task Sequences" node.
  2. Right click on the affected Task Sequence and choose "Edit".
  3. Find any "Request State Store"/"Request User State Store" and "Release State Store"/"Release User State Storage" tasks and disable them. They can be disabled by clicking on the individual tasks, clicking on the "Options" tab, and then clicking on the option "Disable this step". If none of these tasks exist in the Task Sequence, continue to Step 4.
  4. Find any "Format and Partition Disk"/"Partition Disk"/"Partition Disk 0" tasks and disable them. They can be disabled by clicking on the individual tasks, clicking on the "Options" tab, and then clicking on the option "Disable this step". If none of these tasks exist in the Task Sequence, continue to Step 5.
  5. If a task "Set Local State Location" already exists before the "Capture User State"/"Capture User Files and Settings" task, skip to Step 6. Otherwise, click on the "Capture User State"/"Capture User Files and Settings" task to select it and then go to "Add" --> "General" --> "Set Task Sequence Variable". This should create a "Set Task Sequence Variable" task before the "Capture User State"/"Capture User Files and Settings" task.
  6. In the newly created "Set Task Sequence Variable Task":
    • Next to the "Name:" text box, enter in:
      Set Local State Location
    • Next to the "Task Sequence Variable:" text box, enter in
      OSDStateStorePath
    • Next to the "Value:" text box, enter in:
      %SystemDrive%\UserState
      If there was already a "Set Task Sequence Variable Task" task in the Task Sequence that sets the OSDStateStorePath variable, make sure that it is configured to the above value.
  7. Click on the "Capture User State"/"Capture User Files and Settings" task to select it and then go to "Add" --> "General" --> "Set Task Sequence Variable". This should create a "Set Task Sequence Variable" task before the "Capture User State"/"Capture User Files and Settings" task and after the "Set Local State Location".
  8. In the newly created "Set Task Sequence Variable Task":
    • Next to the "Name:" text box, enter in:
      Set USMT Additional Capture Options
    • Next to the "Task Sequence Variable:" text box, enter in:
      OSDMigrateAdditionalCaptureOptions
    • Next to the "Value:" text box, enter in:
      /nocompress /hardlink
      If there was already a "Set Task Sequence Variable Task" in the Task Sequence that defined the variable OSDMigrateAdditionalCaptureOptions with some options, such as /ue, then add the additional options /nocompress /hardlink in the "Value:" text box after the options that already exist. Make sure that there is a space between each option.
  9. Click on the "Capture User Files and Settings"/"Capture User State" task to select it:
    • Ensure that the package under "User state migration tool package:"  is a USMT 4 package.
    • Check the option "Enable verbose logging".
    • Click on the "Options" tab and then uncheck the option "Continue on error".
  10. Click on the "Setup Windows and ConfigMgr" task. Ensure that the package selected next to the "Package" field is a package that installs the SP2 version of the ConfigMgr 2007 client. RTM and SP1 versions of the client will not work with USMT 4.
  11. Click on the "Restore User State"/"Restore User Files and Settings" task and then go to "Add" --> "General" --> "Set Task Sequence Variable". This should create a "Set Task Sequence Variable" task before the "Restore User State"/"Restore User Files and Settings" task.
  12. In the newly created "Set Task Sequence Variable Task":
    • Next to the "Name: " text box, enter in:
      Set USMT Additional Restore Options
    • Next to the "Task Sequence Variable:" text box, enter in:
      OSDMigrateAdditionalRestoreOptions
    • Next to the "Value:" text box, enter in:
      /nocompress /hardlink
      If there was already a "Set Task Sequence Variable Task" in the Task Sequence that defined the variable OSDMigrateAdditionalRestoreOptions with some options, such as /lac, then add the additional options /nocompress /hardlink in the "Value:" text box after the options that already exist. Make sure that there is a space between each option.
  13. Click on the "Restore User Files and Settings"/"Restore User State" task:
    • Ensure that the package under "User state migration tool package:"  is a USMT 4 package.
    • Check the option "Enable verbose logging".
  14. Click on the "OK" or "Apply" button to save the task sequence.

Notes on the two above methods:

  • A "Format and Partition Disk" task is not desired in the above Task Sequences. If a format and partition of the disk occurred, it would wipe all data on the drive, including the State Store, and the captured data would be lost. Instead, to erase content off of the drive in preparation to install the new Windows OS, during the "Apply Operating System Image"/"Apply Operating System" task, a recursive delete of all files and directories occurs on the drive minus a few protected folders.

The protected folders that are not deleted include the Task Sequence cache folder and the State Store folder. The Task Sequence cache folder path is stored in the variables _SMSTSMDataPath , _SMSTSClientCache, and _SMSTSNewClientCachePathToCleanup and usually resolves to the path C:\_SMSTaskSequence. The State Store path is stored in the variable OSDStateStorePath. The protected folders that will not be wiped are stored in the variable _SMSTSProtectedPaths.

In the SMSTS.log you will see the recursive delete and wipe process logged as something similar to the following:

Wiping C:\                                                                                               ApplyOperatingSystem
Set "C:\_SMSTaskSequence" to not be wiped                                             ApplyOperatingSystem
Set "%OSDStateStorePath%" to not be wiped                                             ApplyOperatingSystem
Set "%_SMSTSClientCache%" to not be wiped                                            ApplyOperatingSystem
Set "%_SMSTSNewClientCachePathToCleanup%" to not be wiped                ApplyOperatingSystem
Skipping C:\_SMSTaskSequence for wipe                                                   ApplyOperatingSystem
Calculating expected free space.                                                                ApplyOperatingSystem
Reporting deletion progress.                                                                      ApplyOperatingSystem
Successfully wiped C:\                                                                              ApplyOperatingSystem

  • In Step 15 (Method 1) and Step 6 (Method 2), the State Store path location is changed from %_SMSTSUserStatePath% to %SystemDrive%\UserState. The _SMSTSUserStatePath variable normally resolves to the path C:\_SMSTaskSequence\UserState. The C:\_SMSTaskSequence folder is the Task Sequence cache folder. This is done to fix several issues that can be caused by saving the State Store in the Task Sequence cache folder. These problems include:
    1. Whether or not a Task Sequence succeeded, the Task Sequence usually exits cleanly. When the Task Sequence exists cleanly, it deletes the Task Sequence cache folder of C:\_SMSTaskSequence. This can be a problem if the Task Sequence fails for whatever reason before the captured user data is restored.
      If the Task Sequence fails but exists cleanly before the user data is restored, then the cache folder of C:\_SMSTaskSequence is deleted, which will cause the C:\_SMSTaskSequence\UserState user State Store folder located within the C:\_SMSTaskSequence folder to also be deleted. The captured data will then be deleted and lost before it can be restored.
      If instead the State Store is specified to be a folder outside of the Task Sequence cache folder, such as C:\UserState, when the Task Sequence exists cleanly, it will not automatically delete the State Store since it is no longer within the Task Sequence cache folder. The Task Sequence cache folder will still be deleted, but the State Store will not. In case of Task Sequence failures before user data is restored, user data can still be restored from the State Store using manual methods.
      See KB958808 for additional information:
      User data from the USMT may be deleted unexpectedly by the task sequence engine during the operating system deployment process in System Center Configuration Manager 2007 SP1
      http://support.microsoft.com/kb/958808

      Note: KB958808 does not have to be installed in ConfigMgr 2007 SP2 as this hotfix is already included as part of SP2.
    2. Given the following scenario on a PC:
      1) PC has two (or multiple) drives or partitions
      2) User profiles and Windows are located on the first drive or partition (assume drive letter C:)
      3) Second drive or partition has more available free space than the first (assume drive letter D:)
      then the Task Sequence cache folder will probably be created on the second drive/partition (D:).
      In these scenarios the variable _SMSTSUserStatePath would resolve to the path D:\_SMSTaskSequence\UserState. This is a problem when using USMT 4 hardlinking because the hardlink store has to be on the same drive/partition as Windows and the user profiles. In the above scenario, Windows and the user profiles would be on C:, but the State Store would be created on D:. USMT 4 will actually capture the data in this scenario and not cause any errors, but the captured data will be invalid and it will not be able to be properly restored.
      By making sure that we save the State Store to the drive that contains Windows and user profiles via the variable SystemDrive, we make sure that this problem does not occur.
    3. There are known scenarios when going from a Windows OS with UAC off to a Windows OS with UAC on that will cause permissions not to be set properly on the State Store if the State Store is located within the Task Sequence cache folder. In these scenarios, user data is restored successfully, but the user will receive an "Access Denied" error message when trying to access their files. Saving the State Store outside of the Task Sequence cache folder will resolve the problem.
  • Even though in Step 15 (Method 1) and Step 6 (Method 2) it is recommended that the State Store be saved to a location outside of the Task Sequence cache folder so that it is not automatically deleted, it is still advisable to delete the State Store at some point after the Task Sequence has completed and the user state has been verified that it has been restored successfully. This can be done properly via the usmtutils.exe utility included with USMT 4. To properly remove the State Store, run the command:

usmtutils.exe /rd <Path_to_State_Store>

where <Path_to_State_Store> is the path as specified in the OSDStateStorePath variable via the "Set Local State Location" task (without the brackets <>).

Not deleting the State Store can cause the following problems:

  • If an administrator tries to access the State Store, it may change the permissions of all of the user files in the State Store to the administrator's permissions. This may cause users not to be able to access their files and they may receive "Access Denied" error messages. For this reason it is recommended that an administrator not try to access the State Store directly.
  • A user deleting files in their profile will not cause the actual file to be deleted since a second link exists to the file in the State Store. Although the user will no longer see the file in their profile, the link to the file will still exist in the State Store, and disk space will not be freed up.
  • In Step 18 (Method 1) and Step 9 (Method 2), the option "Continue on Error" is disabled. This option is originally enabled because with USMT 3, USMT 3 could report a lot of false positive errors, causing the task to un-necessarily fail. However this has been improved in USMT 4 and this situation should rarely happen with USMT 4.
    If the option is left checked and the USMT 4 state capture fails for some reason, the Task Sequence will continue and eventually wipe the drive at the "Apply Operating System Image"/"Apply Operating System" task, causing all user files and settings to be deleted and lost. For this reason it is safer to leave this option unchecked when using USMT 4. Leaving the option unchecked will cause the Task Sequence to fail in the event that users' files are not captured successfully, which is a desired outcome.
  • In Steps 18 and 21 (Method 1) and Steps 9 and 13 (Method 2), the option "Enable verbose logging" is enabled. This is optional, but it is advisable to leave this option enabled to help troubleshoot USMT 4 capture and restore failures. Enabling verbose logging will cause the capture and restore tasks to take a bit longer, but will the add the benefit of having more detailed logs to help resolve problems.
  • The tasks "Request State Store" and "Release State Store" are not needed in the Task Sequences that performs local capture with hardlinking because these tasks are only used when a State Migration Point (SMP) is being used. An SMP is only used when the State Store is saved to a network location. When using hardlinking, the State Store is always saved to the local hard drive and an SMP is not used.
  • In Steps 17 and 20 (Method 1) and Steps 8 and 12 (Method 2), please make sure to make the distinction between the variables specified in the tasks "Set USMT Additional Capture Options" and "Set USMT Additional Restore Options". The variables have similar names but they are different. One is OSDMigrateAdditionalCaptureOptionsand the other is OSDMigrateAdditionalRestoreOptions.
More Information
What is a hardlink and why use the USMT 4 feature of hardlinking?

Hardlinking is a feature of NTFS where multiple links can exist to one file on the hard drive. As long as one link exists, the file is not deleted. When a file has multiple links to it, the file will appear to exist in different locations in the file system, but the file only exists once on the hard drive. When the file is deleted from one location, as long as other links to the file still exist, the file is not actually deleted, and the file will still appear in the other locations that it has links to. The file is not deleted until it has been deleted from all of the locations that it has links to.

When USMT local capture is used without hardlinking, files are copied from their original location into the local State Store. For this reason, there has to be sufficient space on the hard drive to store all of the captured files. Even when compression is used, this can mean needing enough space on the hard drive somewhere in the area of almost double the amount of space taken up by the original files. If the original files take 30GB of space, then the hard drive will need about 30GB of free space on it.

When USMT 4 with hardlinking is used, instead of a file being copied to the local State Store, a second link to the file is created in the local State Store. The time taken to create the link to the file in the State Store is almost instantaneous, does not vary with the size of the file, and is much faster than trying to copy the file to the local State Store. The time it takes to capture 30GB of data will only take a bit longer than the time it takes to capture 1GB of data. When not using hardlinking, the amount of time taken to capture 30GB of data would be significantly longer than capturing 1GB of data.

Additionally hardlinking requires almost no additional hard drive space. The only additional hard drive space taken by USMT 4 with hardlinking are administrative files that keep track of where the files need to be restored to. This usually only takes a few MB of disk space vs. the potential GB of disk space taken when hardlinking is not used.

When USMT 4 with hardlinking is used in a ConfigMgr 2007 SP2 Task Sequence via the "Capture User State" task and the OSDStateStorePath
and OSDMigrateAdditionalCaptureOptions variables, during the "Capture User State" task, new links are created for the captured files in the State Store location . All of the original links to the files are then deleted during the "Apply Operating System Image" task via recursive delete and wipe of the hard drive. However, because a second link exists in the State Store, and because the State Store is not deleted or wiped during the "Apply Operating System Image" task, the original files remains intact and are not deleted. Later in the Task Sequence via the "Restore User State" task and the OSDStateStorePath and OSDMigrateAdditionalRestoreOptions variables, the original links to the files are recreated back to their original location.

USMT 4 hardlinking also has the advantage over saving the State Store on a network location, such as a State Migration Point (SMP), in that it does not have to take the time to copy the files up to the network share, bandwidth is not used, and a server with plenty of disk space for saving the State Stores is not needed.

To summarize, USMT 4 with hardlinking has the following advantages:

  1. It is significant faster than either copying the captured files to the local State Store or a State Store located on a network share (SMP).
  2. It requires only a few additional MB of disk space vs potential GB of disk space, whether on the local hard drive or on a network share on a server (SMP).
  3. It saves network bandwidth when opting to use hardlinking over a network share (SMP).

The only disadvantage that hardlinking has is that it could potentially run into problems if there is file corruption on the hard drive, the hard drive has bad sectors, or the hard drive is having some other type of problems. However these problems would also be exposed when using local capture without hardlinking. In these scenarios, running a CHKDSK /R on the hard drive is advisable, and a full format of the drive may also be advisable. A network share (SMP) may be needed in these cases.

Why are the two above methods not valid when using a ConfigMgr 2007 Task Sequence created with the MDT 2010/MDT 2010 Update 1 "Create Microsoft Deployment Task Sequence" Wizard?

The above methods are not valid when using a ConfigMgr 2007 Task Sequence created with the MDT 2010/MDT 2010 Update 1 "Create Microsoft Deployment Task Sequence" Wizard because the Task Sequences created using the Wizard already have hardlinking enabled by default.

If a ConfigMgr 2007 Task Sequence created with the MDT 2010/MDT 2010 Update 1 "Create Microsoft Deployment Task Sequence" Wizard is inspected, it will be missing the "Set Task Sequence Variable" tasks that set the variables OSDStateStorePath, OSDMigrateAdditionalCaptureOptions, and OSDMigrateAdditionalRestoreOptions. So if the Task Sequence is missing the steps that sets these variables, and these variables are required to do hardlinking, how does the Task Sequence accomplish hardlinking?

It does this via the task "Determine Local or Remote UserState" task and the MDT script ztiuserstate.wsf. If the USMT 3 package is selected at the "Determine Local or Remote UserState" task, the ztiuserstate.wsf script determines if there is enough space on the hard drive to do a local capture (without hardlinking since it is USMT 3), and if not, it will perform a network capture via a State Migration Point (SMP). Based on which capture method determined by the ztiuserstate.wsf script is used, it defines the appropriate variables, OSDStateStorePath, OSDMigrateAdditionalCaptureOptions, and OSDMigrateAdditionalRestoreOptions, and along with conditions set on the relevant tasks, the Task Sequence will perform the appropriate capture.

However if the USMT 4 package is selected at the "Determine Local or Remote UserState" task, since disk space is not an issue, the ztiuserstate.wsf script will always default to local capture with hardlinking. It will then set the appropriate variables for the Task Sequence to perform a hardlink migration.

There is one problem though with using the ztiuserstate.wsf script. The ztiuserstate.wsf script defaults the State Store to the subdirectory StateStore within the Task Sequence cache folder. For the reasons stated in the notes above about saving the State Store within the Task Sequence cache folder, it is not always desirable to save the State Store within the Task Sequence cache folder.
The Task Sequence created by the MDT 2010/MDT 2010 Update 1 "Create Microsoft Deployment Task Sequence" Wizard actually works around the first issue (State Store is deleted even if the data was not restored) by moving the State Store out of the Task Sequence cache folder via the ztimovestatestore.wsf script and the "Move State Store" task. The State Store is moved whether or not the Task Sequence succeeds or fails. However the other two problems can still happen.

To resolve the other two problems and save the State Store outside of the Task Sequence cache folder when using a Task Sequence created with the MDT 2010/MDT 2010 Update 1 "Create Microsoft Deployment Task Sequence" Wizard, follow the below steps:

  1. In the ConfigMgr 2007 Admin console, navigate to the "Computer Management" --> "Operating System Deployment" --> "Task Sequences" node.
  2. Right click on the affected Task Sequence created using the MDT Wizard and choose "Edit".
  3. Click on the "Determine Local or Remote UserState" task and then go to "Add" --> "General" --> "Set Task Sequence Variable". This should create a "Set Task Sequence Variable" task after "Determine Local or Remote UserState" task but before the "Request State Store" task.
  4. In the newly created "Set Task Sequence Variable Task":
    • Next to the "Name:" text box, enter in:
      Set Local State Location
    • Next to the "Task Sequence Variable:" text box, enter in
      OSDStateStorePath
    • Next to the "Value:" text box, enter in:
      %SystemDrive%\StateStore
  5. Click on the "OK" or "Apply" button to save the task sequence.

The above steps resets the variable OSDStateStorePath to a path outside of the Task Sequence cache folder after the "Determine Local or Remote UserState" task and the ztiuserstate.wsf script sets it to the StateStore subdirectory within the Task Sequence cache folder.

Can an existing ConfigMgr 2007 Task Sequence that does not have any USMT tasks including the "Capture User State" and "Restore User State" tasks be modified to do USMT 4 hardlinking?

Yes, but the order of the steps and where they are placed in the Task Sequence are critical. The five tasks that need to be added, and the order that they need to run in are as follows:

  • Set Local State Location
  • Set USMT Additional Capture Options
  • Capture User State
  • Set USMT Additional Restore Options
  • Restore User State

In addition, any "Format and Partition Disk" tasks need to be disabled.

The first three tasks, Set Local State Location, Set USMT Additional Capture Options, and Capture User State, have to run in the original full Windows OS before the Task Sequence boots into WinPE. This is usually before a "Restart Computer" task, such as the "Restart in Windows PE" task. The tasks also have to be placed into a group that has a condition where it only runs in the full Windows OS and not in WinPE. This can be accomplished by setting a condition on the group where the Task Sequence variable _SMSTSInWinPE equals false. The prevents the tasks from running in Bare Metal scenarios where the PCs are booted directly into WinPE and state capture is not needed.

The last two tasks, Set USMT Additional Restore Options and Restore User State, have to run in the newly deployed full Windows OS at some point after the "Setup Windows and ConfigMgr" task, preferably towards the end of the Task Sequence after all applications have been installed.

The Capture User State and Restore User State tasks are built in tasks of ConfigMgr 2007. They can be found under the "Add" --> "User State" menu in a Task Sequence.

The Set Local State Location, Set USMT Additional Capture Options, and Set USMT Additional Restore Options are all actually Set Task Sequence Variable tasks. For instructions on how to properly set up these tasks, see the two above methods.

As a general guide and template to modifying the existing Task Sequence, Method 1 above can be used to create a Task Sequence that serves as the template and guide to modifying the existing Task Sequence.

Frank Rojas | System Center Support Escalation Engineer

clip_image001 clip_image002

Bookmark and Share

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment
  • Nice article, but I miss Bitlocker in this story. What if you want to use Hardlink on a pc with Bitlocker enabled?

    Then you need to add two steps:

    The first step of the tasksequence must suspend/disable bitlocker. Add a commandline step with the command  'cscript manage-bde.wsf -protectors -disable c:' (if c: is the encrypted drive). Select as dir C:\Windows\System32.

    The last step of the tasksequence enables Bitlocker again.

    Add a commandline step with the command  'cscript manage-bde.wsf -protectors -enable c::' (if c: is the encrypted drive)

    Daan

  • I adore your site, looks excellent and full of good info. Keep it up.

  • I tried the steps above exactly, and I still get an "Error 50: The request is not supported" during the Task Sequence.

  • I am not using SCCM to do this, just  a Deployment Share....how can I modify the the ZTIUserState.wsf to default to %windir%\statestore?

  • Is there any "how to " guides on the ability to use the "Offline captures are possible using the UDI feature of MDT 2010 Update 1 when it is integrated with ConfigMgr 2007 SP2." you mention ?

  • I used your process under Method 1: Create a new ConfigMgr 2007 Task Sequence that supports USMT 4 hardlinking.  Works wonderful!  I'm just having an issue with Restoring the data.  My SCCM task sequence just skips over the action "Restore User Files and Settings".  I have my User state migration tool package selected.  Also i have tried to use both "Restore all captured user profiles with standard options" and Customizing a xml from the USMT pacakge.  In both cases my task sequence doest restore any data.  When i look on my C root I find a directory called "User state".  Any ideas as to what I should do to get this working?

  • Beautiful and well detailed article! Would be nice some screenshots..

  • Hi i have a problem actually i used Method 1 and all thing is great all data copied to USMT at C but i need to restore data to original place for example i need the user when logon on his machine see all data at desk top for example and so on can you advice me.

  • I followed this exactly.  This is the best article I have found on USMT and SCCM/MDT2010.  I am having a weird "bug" with the USMT not bringing over wallpaper, IE favorites/settings, and I think app settings also aren't coming over.  I have only found one mention of this on google, but nobody has replied to the guy.  Any thoughts?

  • Bit more info to my USMT not bringing over wallpaper and IE favorites, etc....  I have tried both "restore all captured user profiles with standard options" and the "Customize how user profies are restored" and enter in migapp.xml and miguser.xml

    Machine is XP sp3, on a domain---> Win 7 on Domain.  Win 7 image was prepared with MDT 2010, but I am not deploying it (atm) with a MDT task sequence....I used your Method 1 method.

    I am going to test a manual run of USMT from command prompt and see if it works...if so then a batch file/command prompt TS will have to be run.  I can't think of any other way around resolving this issue.

  • This is really a great information.Thanks

  • I have create a fresh task seqence as per above mentioned procedure , but when ever i deploy it it shows fail . any help ...

  • restore user profiles is failing. I can restore local accounts but not domain accounts.

  • Hi J.C

    I suggest you to add reference to your own article support.microsoft.com/.../2018593 :-D

  • I am not able to copy Favorites properly  to user's profiles when using Method 1 going from XP SP3 x86 or Windows 7 Ent x86 to Windows 7 Ent x86. I've applied the fix from support.microsoft.com/.../2018593. Favorites do seem to appear when migrating from x64 fine. I can still copy the Favorites from C:\UserState in x86, but I would rather not do that. Any ideas?