MDT UDI Task Sequence: Restore USMT migration using Computer Association Recovery Key

Problem: You need to restore user migration data from the State Migration Point to a computer other than the destination computer specified in the Computer Assocation in the SCCM database.

Some of the possible solutions to this are:

1. Use the Windows Easy Transfer Wizard to open the .Mig file, enter the the recovery key and restore the user data. This requires NTFS read permissions to the SMP share, administrator rights on the local machine and the Windows Easy Transfer Wizard (built in to Windows 7 and 8, separate install on XP).

2. Run the loadstate command with the appropriate parameters on the local machine to restore the data. This requires NTFS read permissions to the SMP share, administrator rights on the local machine, a copy of the USMT source files, and building a pretty long command line, which is not very practical.

Solution: The solution I used was to build an SCCM/MDT task sequence that uses the UDI Wizard to prompt the technician for the recovery information (state store location and state recovery key), authenticate to the SMP share with a service account and run the loadstate command to restore the data on to the machine. Some of the advantages of this method are:

  • A service account is used to access the SMP share, so you don’t have to grant permissions to technicians/users.
  • The task sequence is run in the system context, so local administrator rights are not needed on the client.
  • You can specify a consistent loadstate command with logging.
  • The process is overall more secure, robust, traceable and easy to use.

This solution uses the \”Build Your Own Page\” feature in the UDI Wizard included in MDT 2012 Update 1.

Step 1 – Create the Service Account

Create a domain account to be used as a service account by the task sequence to access the state migration point. Grant the account NTFS read permission to the SMP share on your SCCM server.

Step 2 – Create the UDI Wizard Page

Using the UDI Wizard Designer, create a new file. Select a StageGroup (I chose Refresh). Click on each page and select \”Remove Item\”. You can leave a Welcome page and a Summary page if desired.

Select \”Add Page\” > \”Build Your Own Page\”. Use the DisplayName \”USMT Recovery Page\” and the Page Name \”USMTRecoveryPage\”.

Create a Label: \”Enter the user state store location:\”
Create a Label: \”Enter the user state recovery key:\”

Create a TextBox with the variable name \”StateStoreLocation\” and friendly name \”State Store Location\”. Assign a \”NonEmpty\” validator and appropriate message:

\"Build2\"

Create a TextBox with the variable name \”RecoveryKey\” and friendly name \”RecoveryKey\”. Assign a \”NonEmpty\” validator and appropriate message:

\"Build3\"

You should now have only the USMT Recovery Page and an optional Welcome/Summary Page:

\"Build4\"

Save the Wizard page as \”UDIWizard_Config_StateMigrationRecovery.xml\”

Step 3 – Create the Task Sequence

From the SCCM console Task Sequences node, select \”Create MDT Task Sequence\”.

Select “Microsoft Deployment Custom Task Sequence”.

Follow the wizard and select the packages to use in the task sequence. We will discard most of the default steps to create a custom task sequence, so it\’s not important what options you choose in the wizard.

When the wizard is complete, delete the steps except those you can use in the task sequence below.

\"TS1\"

The Toolkit Package should point to your MDT 2012 Update 1 folder with the custom UDI wizard page you created.

The Gather step should point to a customsettings.ini file. In your customsettings.ini file, make sure the deployment type matches the stage you used to create the Wizard page, e.g. \”DeploymentType=Refresh\”

Add a \”Run Command Line\” step with the name \”UDI Wizard\” and the following command line:

cscript.exe \”%DeployRoot%\\Scripts\\UDIWizard.wsf\” /definition:UDIWizard_Config_StateMigrationRecovery.xml

Add a \”Run Command Line\” step with the name \”Connect to Network Folder\”. Use the variable %StateStoreLocation% for the path and select the service account you created above.

\"TS2\"

Add a \”Run Command Line\” step with the name \”Restore User Data\”. Check the box to use the USMT package and enter the following command line (substitute your own loadstate options where applicable):

%PROCESSOR_ARCHITECTURE%\\loadstate.exe %StateStoreLocation% /ue:*\\* /ui:domain\\* /v:5 /c /l:%logpath%\\loadstate.log /progress:%logpath%\\loadstateprogress.log /decrypt /key:\”%RecoveryKey%\” /i:\”%PROCESSOR_ARCHITECTURE%\\MigUser.xml\” /i:\”%PROCESSOR_ARCHITECTURE%\\MigApp.xml\” /config:\”%PROCESSOR_ARCHITECTURE%\\Config.xml\”

The values of the %StateStoreLocation% and %RecoveryKey% variables are picked up from the fields you populate in the UDI wizard.

Step 4 – Deploy the Task Sequence to a collection

Deploy the task sequence to an appropriate collection. Use the task sequence to restore user migration data from an existing computer association to a different computer destination. When prompted by the UDI Wizard, copy and paste the recovery information from the computer association in the \”User State Migration\” node in SCCM.

Practical Note: Typing out the state store location and state recovery key is not an option – the state store location can be over 100 characters and the recovery key is 256 characters. The easiest and most appropriate ways to populate the fields in the UDI Wizard would probably be to use the ConfigMgr Remote Control Viewer and copy/paste, or to send an (encrypted) email to the user with the recovery data and copy/paste.

1 thought on “MDT UDI Task Sequence: Restore USMT migration using Computer Association Recovery Key”

  1. Pingback: MDT UDI Task Sequence: Restore USMT migration using Computer Association Recovery Key « Random thoughts of a System Center Admin…

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top