This post started as a local copy of http://powersheller.wordpress.com/2012/08/29/sccmmdt-2012-task-sequence-to-restore-user-migration-from-smp-using-computer-association-recovery-information/ however I have since modified it to suit my style of deployment. So I am giving credit to the post that I got me to where I am today.
Problem: You need to restore user migration data from the State Migration Point (SMP) to a computer other than the destination computer specified in the Computer Association in the System Center 2012 Configuration Manager (SCCM) database.
Solution: The most effective solution is to build an SCCM/MDT task sequence that uses the UDI Wizard to prompt for the recovery information (state store location and state recovery key), connect to the SMP share with a dedicated service account and execute the loadstate command to restore the data on to the machine.
Advantages to this solution:
- 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. This account does not require any administrator rights, standard Domain User is sufficient. Grant the account NTFS read permission to the SMP share on your SCCM servers hosting the SMP Role.
Step 2 – Create the UDI Wizard Page
Using the UDI Wizard Designer, create a new file. Select the StageGroup 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.
Drag and Drop USMT Recovery Page from Page Library –> CustomPage onto the StageGroup Refresh.
Double Click on USMT Recovery Page
Create Two Labels with the following Settings:
- Label: Enter the user state store location:
- Label: Enter the user state recovery key:
Create two Textboxes with the following settings:
Text Box under Enter the user state store location:
- Variable Name: StateStoreLocation
- Friendly Name: State Store Location.
- Validator: NonEmpty
- Validator Message: State Store Location is a required field.
Text Box under Enter the user state recovery key:
- Variable Name: RecoveryKey
- Friendly Name: Recovery Key.
- Validator: NonEmpty
- Validator Message: Recovery Key is a required field.
Save the Wizard page as UDIWizard_Config_StateMigrationRecovery.xml and add it to the MDT Toolkit Package in your SCCM Infrastructure.
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.
Most of the default settings will be deleted from the task sequence so it’s not important what options you choose in the wizard.
When the wizard is complete, delete all the steps except:
- Use Toolkit Package
- Gather
Add the following Step to the Task Sequence above the Use Toolkit Package step:
Set DeploymentType
- Type: Name: Set Task Sequence Variable
- Name: Set DeploymentType
- Task Sequence Variable: DeploymentType
- Value: Refresh
Add the following Steps to the Task Sequence below the Gather step:
UDI Wizard
- Type: Run Command Line
- Name: UDI Wizard
- Command Line: cscript.exe “%DeployRoot%\Scripts\UDIWizard.wsf” /definition:UDIWizard_Config_StateMigrationRecovery.xml
- Disable 64-bit file system redirection: Unchecked
- Start in: <Blank>
- Package: Unchecked
- Time-out (minutes): Unchecked
- Run this step as the following account: Unchecked
Connect to State Store Location
The value of % StateStoreLocation % is retrieved from the fields you populate in the UDI wizard.
- Type: Connect to Network Folder
- Name: Connect to State Store Location
- Path: %StateStoreLocation%
- Drive: <Blank>
- Account: Service Account created earlier
Restore User Data
The command line in this step should be updated to reflect your Mig*.xml files.
The value of %RecoveryKey% is retrieved from the fields you populate in the UDI wizard.
- Type: Run Command Line
- Name: Restore User Data
- Command Line: %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”
- Disable 64-bit file system redirection: Unchecked
- Start in: <Blank>
- Package: Checked
- Package used: User State Migration Toolkit
- Time-out (minutes): Unchecked
- Run this step as the following account: Unchecked
Copy Logs
- Type: Run Command Line
- Name: Copy Logs
- Command Line: cscript “%deployroot%\scripts\zticopylogs.wsf”
- Disable 64-bit file system redirection: Unchecked
- Start in: <Blank>
- Package: Unchecked
- Time-out (minutes): Unchecked
- Run this step as the following account: Unchecked
I typically copy Gather Logs and StateStore on Failure from a standard MDT Task Sequence so that in the event of a Task Sequence Failure I can have the logs copied up to a Network location defined as SLShare.
Step 4 – Deploy the Task Sequence to a collection
Deploy the task sequence to a 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.
Note: Although you can type out the state store location and state recovery key this should not be considered 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 the data into the UDI Wizard.
Leave a Reply