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/
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.