Some basic USMT 4.0 actions explained

The last few weeks a saw and got a lot of questions about capturing specific files and folders with USMT. These actions are actually quite basic and good documented on Technet, but still seem to raise a lot of questions. So I decided to devote a post to this. I will show some examples and will try to explain what it all means. Let’s start with a component that migrates all files in a specific folder.

<component type=”Documents” context=”System”> 
<displayName>Component to migrate all files in a specific folder including subfolders</displayName> 
   <role role=”Data”> 
      <rules> 
         <include> 
            <objectSet> 
               <pattern type=”File”>C:\SpecificFolder\* [*]</pattern> 
            </objectSet> 
         </include> 
      </rules>
   </role>
</component>

Well, that’s a nice component but what does it all mean? Let’s go through it line-by-line

<component type=”Documents” context=”System”> </component>

The <component> element is a required element in a custom .xml and describes the basic construct. After that the component type specifies the kind of files that will be captured. In this case it’s the documents, which actually includes almost all files. At last the component context specifies the scope of the capture. The scope can also be set in the <rules> element, but largest scope is defined in the <component> element. In this case the context is the whole operating system.

<displayName>Component to migrate all file in a specific folder including subfolders</displayName>

The <displayName> element is a required element within a <component> element. This name will show up in a config.xml as a component that can be enabled during migration.

<role role=”Data”>

The <role> element is a required element in a custom .xml and is used to concrete the component. The parameters used in this element do NOT change the migration behavior and are only used for categorizing the migration settings.

<rules><include><objectSet><pattern type=”File”>C:\SpecificFolder\* [*]</pattern></objectSet></include></rules>

The <rules> element is a required element in a custom .xml and contains all the rules that will be run during a migration.

The <include> element is a required element within a <rules> element and determines what will be migrated.

The <objectSet> element is a required element within a <include> element and contains the list of the specific objects that need to be migrated. This can be anything from registry keys until specific files. In this example it contains all the documents and files within C:\SpecificFolder\. By specifying the * it migrates all the subfolders and by specifying [*] also migrates all the files. To find only a specific file in the specific folder and subfolders change the * between the brackets for the name of the specific file.

Well, that hopefully already explains a lot, but what if we also want to exclude some files? To exclude a specific file or folder add an <exclude> element to the <rules> element, to specify which file and/ or folder should be excluded from the migration. To exclude SpecificFile.txt from somewhere in the SpecificFolder, the .xml file would go look like this.

<component type=”Documents” context=”System”>
<displayName>Component to migrate all Documents in a specific folder including subfolders</displayName>
   <role role=”Data”>
      <rules>
         <include>
            <objectSet>
               <pattern type=”File”>C:\SpecificFolder\* [*]</pattern> 
            </objectSet>
         </include>
         <exclude>
            <objectSet>
               <pattern type=”File”>C:\SpecificFolder\* [SpecificFile.txt]</pattern> 
            </objectSet> 
         </exclude>
      </rules>
   </role>
</component>

Well, that hopefully already gives some more possibilities, but what if we also want to migrate these specific files and folders to a different location on the destination machine? To migrate to a different location add a <locationModify> element to the <rules> element. This element only gets evaluated during the loadstate. By using the RelativeMode script and specifying the specific files and/ or folders in the <objectSet> element, it can move files and folders from the location on the source machine the a new location on the destination machine. To move the C:\SpecificFolder contents to C:\Temp the .xml would go look like this.

<component type=”Documents” context=”System”>
<displayName>Component to migrate all Documents in a specific folder including subfolders</displayName>
   <role role=”Data”>
      <rules>
         <include>
            <objectSet>
               <pattern type=”File”>C:\SpecificFolder\* [*]</pattern> 
            </objectSet> 
         </include>
         <locationModify script=”MigXmlHelper.RelativeMove(‘C:\SpecificFolder\’, ‘C:\Temp\’)”>
            <objectSet>
               <pattern type=”File”>C:\SpecificFolder\* [*]</pattern>
            </objectSet>
         </locationModify>
      </rules>
   </role>
</component>

See for the whole XML Elements Library: http://technet.microsoft.com/en-us/library/dd560769(v=ws.10).aspx

Share

Using USMT 4.0 and ConfigMgr 2007 while migrating from local profiles to partially redirected profiles

This time I want to devote a post to a situation I haven’t been in that often. The customer was migrating from Windows XP to Windows 7, well.. nothing special here, but also migrating from local profiles to (partially) redirected profiles, well.. that’s a challenge. So to capture the userdata AND -settings we had to come up with something special. Of course we could do some things with scripting, but the biggest challenge was the fact that the new (partially redirected) profile location was only available after the first logon to Windows 7.

With this information I started thinking about USMT 4.0 again. Most often you use this to migrate on a computer basis, but we made an exception on this. We came up with the following five steps that should do the trick:

  1. (On Windows XP) A batch file that kicks of Scanstate. Nothing special here, just used /uel:1 or /uel:0 to get the user profile we need (0=Logged on user, 1=Modified accounts last 24 hours).
  2. (On Windows XP) A batch file that copies the captured data and settings to the users share on the network.
  3. (On Windows 7) A batch file that copies the captured data and settings back to a local drive.
  4. (On Windows 7) A batch file that kicks of Loadstate. Nothing special here, just used /ue to exclude some possible captured local/ admin account.
  5. (On Windows 7) A batch file that copies the last bits of data straight in to the redirected profile.

The important part is something a didn’t mention yet. In the migration XML files there is the possibility to copy data to an alternative location and that’s what we used for the parts of the profile that would get redirected. The reason for that is simple, because the SYSTEM account has no security rights to write something to there, as it is a network location. Here is a sample of the part we added to the migration XML files:

<locationModify script="MigXmlHelper.RelativeMove(‘%CSIDL_DESKTOP%\’, ‘C:\Temp\Desktop’)">
   <objectSet>
      <pattern type="File">%CSIDL_DESKTOP%\* [*]</pattern>
   </objectSet>    
</locationModify>

This specific part would copy the desktop items to C:\Temp\Desktop instead of the desktop location in the (redirected) profile. Also important to note is that, in this case, all the copy actions have to run with user rights, as it’s all copied to the users directory.

Share

How to Capture User Files and Settings Offline (WinPE) or Online (FullOS) using hard-links with ConfigMgr 2012 B2

This post will be another one about capturing user files and settings, but this time with ConfigMgr 2012 B2. I hope everyone still remembers my post about capturing user files and settings in ConfigMgr 2007 (and especially how much work it was). Usually I’m not really into writing ‘step-by-step guides’, but this time I will make an exception. The reason why I’m making this exception is that I want to show how easy it’s done now. It’s becoming really close to just next-next-finish. There are only four packages needed for/ by this step-by-step:

  1. Boot image package
  2. ConfigMgr client package
  3. USMT 4.0 package
  4. Image package

When these packages are present, right-click the Task Sequence node and select Create Task Sequence. After that follow the step-by-step below.

 

On the Create a New Task Sequence page, select Install an existing image package and click Next

CTSW_NewTS

On the Task Sequence Information page, fill in a Task sequence name, Browse for the Boot image and click Next.

CTSW_TSInf

On the Install Windows page, browse for the Image package, uncheck Partition and format the target computer before installing the operating system, (optional) fill in a Product key, (optional) select Always use the same administrator password and click Next.

Note: It’s really important to uncheck Partition and format the target computer before installing the operating system, because otherwise it’s not possible to store the data locally.

CTSW_InstWin

On the Configure Network page, (optional) select Join a domain, Browse for the Domain and Domain OU, Set an Account and click Next.

CTSW_ConfNetw

On the Install ConfigMgr page, Browse for the ConfigMgr client Package, (optional) fill in the Installation Properties and click Next.

CTSW_InstClnt

On the State Migration page, select Capture user settings, Browse for the USMT Package, select Save user settings locally and click Next.

CTSW_StatMigr

On the Install Updates page, click Next.

Note: As these settings are not part of the step-by-step, they are left to default.

CTSW_InclUpd

On the Install Applications page, click Next.

Note: As these settings are not part of the step-by-step, they are left to default.

CTSW_InstAppl

On the Summary page, click Next.

image

On the Progress page, just wait…

CTSW_Prog

On the Confirmation page, click Close.

CTSW_Conf

Now the basic task sequence is ready and it only needs a little bit of ‘tweaking’. This can be done with the Task Sequence Editor. Also notice that the basic task sequence already sets the ‘extra’ task sequence variable OSDStateStorePath.

Select the Capture Files and Settings Group, go to the Options tab and Remove the Conditions (or remove the whole top Group).

Note: This is necessary to make it possible to also capture user files and settings  in WinPE.

image

Select the Capture User Files and Settings Step (optional: change the name), select Copy by using file system access and check Continue if some files cannot be captured and Capture locally by using links instead of copying files. Now go to the Options tab and add the condition of _SMSTSInWinPE equals FALSE.

Note: This is necessary to make this step only run in FullOS.

TSed_CaptFullOS

Add an extra Capture User State Step (optional: change the name), select Copy by using file system access and check Continue if some files cannot be captured, Capture locally by using links instead of copying files and Capture in off-line mode (Windows PE only). Now go to the Options tab and add the condition of _SMSTSInWinPE equals TRUE.

Note: This is necessary to make this step only run in WinPE.

TSed_CaptWinPE

The task sequence is now done and ready to be deployed. The result is a task sequence that will do a hard-link migration in both, WinPE or FullOS.

Share

ConfigMgr vNext: It just gets easier and easier.

Its about time that I write my first post about ConfigMgr vNext BETA and well I really have to say that it just gets easier and easier compared to ConfigMgr 2007. The only thing I have to get used to is that everything is in a different location.

Capture User Files and Setting Offline (WinPE) with Hard-Links

HardLinkOnOffvNextAs I have been busy a lot with capturing user files offline on my blog, lets start about how easy that becomes in ConfigMgr vNext. I still remember making BAT-files to run the ScanState –commands, in ConfigMgr vNext its just selecting the checkboxes Capture locally using links instead of copying files and Capture in off-line mode (WinPE only). After this the Capture User Files and Settings –step will run with the command C:\_SMSTaskSequence\Packages\P010000A\amd64\scanstate.exe C:\_SMSTaskSequence\UserState /o /localonly /efs:skip /all /v:5
/offlineWinDir:C:\WINDOWS /c /hardlink
/nocompress /l:X:\WINDOWS\TEMP\SMSTSLog\scanstate.log
/progress:X:\WINDOWS\TEMP\SMSTSLog\scanstateprogress.log
/i:C:\_SMSTaskSequence\Packages\P010000A\amd64\miguser.xml /i:C:\_SMSTaskSequence\Packages\P010000A\amd64\migapp.xml.

Even the variable OSDStateStorePath gets set to %_SMSTSUserStatePath% automatically by selecting Save user settings locally during the Create Task Seqeunce Wizard.

Schedule Updates on a Operating System Image

ImageProp Another cowl feature I ran into, with creating the Operating System Image for the Task Sequence, is the option to Schedule Updates for an already created Operating System Image. By doing this ConfigMgr will insert the selected updates into the Operating System Image. No more problems with installing Software Updates during the Build and Capture –proces, can it get easier then this?

After this it is also possible to see the which Software Updates exist in the Operating System Image (see picture). Now you will always be able to see how up-to-date your reference image is!

Of course there are lots and lots of more cowl feature, like the Software Center, the Online Software Catalog, the Automatic Grouping Rules for Software Updates, the Client Agent Settings, etc, etc, etc… But, at my defence, these are all to big to be covered in one post.

Share

Capture User Files and Settings Offline (WinPE) or Online (FullOS) with ConfigMgr 2007

They always say never change a winning team, but sometimes its just cowl to see if its possible to be even better. I had the same with a previous post in which I already showed how to do a Hard-Link migration, when started from WinPE (and FullOS). The biggest part of that example is still the same, but some pieces changed to get a better result.

In this post I will go step-by-step (again) to mention the changes that I made to make it even better. At the end of both parts of this post I will shine a light on the changes that I made.

Part 1: Capture User Files and Settings

HardlinkOnOffTSFor creating a Task Sequence, that does an Online or Offline Capture, my way, a few variables and locations need to be created. After that a command line has to be run to do the actual Capture. Under here I will sum up the steps I take to do an Online and Offline Capture (also see the first red rectangle in the picture):

  • Set Started in WinPE – Set Task Sequence Variable
    This step sets the Task Sequence Variable TSStartedInWinPE to YES. This Task Sequence Variable only gets set when _SMSTSInWinPE is TRUE.
  • Set Architecture – Set Task Sequence Variable
    This step sets the Task Sequence Variable Architecture to amd64. This variable will be used for selecting the USMT 4.0 version for (in my case) 64-bit systems.
  • Set Windows Partition – Set Task Sequence Variable
    This step sets the Task Sequence Variable WindowsPartition to C:. This variable will be used for selecting the Windows partition.
  • Set State Store Location – Set Task Sequence Variable
    This step sets the Task Sequence Variable OSDStateStorePath to %WindowsPartition%\StateStore. This variable will be used for creating and selecting the User State Location.
  • Create State Store Location – Run Command Line
    This step creates the directory %WindowsPartition%\StateStore by running the Command line: cmd /c MKDIR %OSDStateStorePath%.
  • Cache USMT Files and Scripts – Run Command Line
    This step caches the USMT Files and Scripts from the USMT Package to the directory %OSDStateStorePath%\USMTFiles\ by running the Command line: xcopy * %OSDStateStorePath%\USMTFiles\ /herciy
  • Capture User Files and Settings – WinPE – Run Command Line
    This step does the actual Offline Capture of the User Files and Settings by running the Command line RunScanState_WinPE.BAT %OSDStateStorePath% %WindowsPartition% %Architecture% %_SMSTSLogPath% which has to start in the directory %OSDStateStorePath%\USMTFiles\. This step only runs when the machine is started from WinPE. This is done by checking if the Task Sequence Variable TSStartedInWinPE is set to YES.
  • Capture User Files and Settings – FullOS – Run Command Line
    This step does the actual Online Capture of the User Files and Settings by running the Command line RunScanState_FullOS.BAT %OSDStateStorePath% %WindowsPartition% %Architecture% %_SMSTSLogPath% which has to start in the directory %OSDStateStorePath%\USMTFiles\. This step only runs when the machine is started from FullOS. This is done by checking if the Task Sequence Variable TSStartedInWinPE is not set to YES. 

These are all the steps I need, to do an Online or Offline Capture with Hard-Links. Now let’s take a closer look at the batch-files which do the most of the work:

RunScanState_FullOS.BAT

REM ======================================================
REM ARGUMENT -1- OSDStateStorePath     = %1
REM ARGUMENT -2- WindowsPartition    = %2
REM ARGUMENT -3- Architecture        = %3
REM ARGUMENT -4- LogDirectory        = %4
REM ======================================================

SET USMT_WORKING_DIR=%1\USMTFiles\%3

REM ======================================================
REM RUN Scanstate
REM ======================================================

"%1\USMTFiles\%3\Scanstate.exe" "%1" /o /hardlink /nocompress /i:%1\USMTFiles\%3\MigUser.xml /i:%1\USMTFiles\%3\MigApp.xml /localonly /l:%4\ScanState.log /v:5 /progress:%4\ScanStateProgress.log /c /efs:hardlink

REM ======================================================
REM EXIT Errorlevel
REM ======================================================

EXIT /b %errorlevel%

RunScanState_WinPE.BAT

REM ======================================================
REM ARGUMENT -1- OSDStateStorePath     = %1
REM ARGUMENT -2- WindowsPartition    = %2
REM ARGUMENT -3- Architecture        = %3
REM ARGUMENT -4- LogDirectory        = %4
REM ======================================================

SET USMT_WORKING_DIR=%1\USMTFiles\%3

REM ======================================================
REM RUN Scanstate
REM ======================================================

"%1\USMTFiles\%3\Scanstate.exe" "%1" /o /hardlink /nocompress /i:%1\USMTFiles\%3\MigUser.xml /i:%1\USMTFiles\%3\MigApp.xml /offlinewindir:%2\Windows /localonly /l:%4\Scanstate.log /v:5 /progress:%4\Scanstateprogress.log /c /efs:hardlink

REM ======================================================
REM EXIT Errorlevel
REM ======================================================

EXIT /b %errorlevel%

The changes that I made in Part 1: Capture User Files and Settings are the following two:

  1. I use now a batch-file for both, and Online and Offline Capture.
    Why? Just because it gives me more flexibility and because I can get rid of a few “double” steps. For example, now I can use the same Store Location (variable) for both Captures Types.
  2. I use now a different location for the logfiles.
    Why? Just because it gives me an easy possibility to save the log until the end of the Task Sequence.

Part 2: Restore User Files and Settings

After the User Files and Settings have been captured, they need to be restored again to the new OS. This is the same for an Online and Offline Capture. Under here I will sum up the steps that I use to restore the Files and Settings:

  • Restore User Files and Settings – Run Command Line
    This step does the actual Restore of the User Files and Settings by running the Command line RunLoadState.BAT %OSDStateStorePath% %WindowsPartition% %Architecture% %_SMSTSLogPath% which has to start in the directory %OSDStateStorePath%\USMTFiles\..
  • Cleanup State Store Location – Run Command Line 
    This step cleans up the State Store Location by running the command line RunUSMTutils.BAT %OSDStateStorePath% %Architecture%
  • Restart in FullOS – Restart Computer (see the second red rectangle in the picture)
    This step will restart the computer, but only when _SMSTSLastActionRetCode is equal to 2.

These are all the steps I need, to do a Restore with Hard-Links. Now let’s take a look at the batch-files which do most of the work here:

RunLoadState.BAT

REM ======================================================
REM ARGUMENT -1- OSDStateStorePath     = %1
REM ARGUMENT -2- WindowsPartition    = %2
REM ARGUMENT -3- Architecture        = %3
REM ARGUMENT -4- LogDirectory        = %4
REM ======================================================

SET USMT_WORKING_DIR=%1\USMTFiles\%3

REM ======================================================
REM RUN LoadState
REM ======================================================

"%1\USMTFiles\%3\Loadstate.exe" "%1" /hardlink /nocompress /lac /i:%1\USMTFiles\%3\MigUser.xml /i:%1\USMTFiles\%3\MigApp.xml /l:%4\LoadState.log /v:5 /progress:%4\LoadStateProgress.log /c

REM ======================================================
REM EXIT Errorlevel
REM ======================================================

EXIT /b %errorlevel%

RunUSMTutils.BAT

REM ====================================================== 
REM VARIABLE -1- OSDStateStorePath = %1
REM VARIABLE -2- Architecture = %2
REM ======================================================

REM ======================================================
REM RUN USMTUtils
REM ======================================================

echo y| "%~dp0%2\usmtutils.exe" /rd "%1"

REM ======================================================
REM EXIT Errorlevel
REM ======================================================

EXIT /b %errorlevel%

The changes that I made in Part 2: Restore User Files and Settings are the following two:

  1. I use now also batch-file for the Restore.
    Why? Just because it gives me more flexibility and because I can get rid of a “double” step (setting the Hardlink options).
  2. I use now an optional restart of the computer.
    Why? Because I noticed that sometimes USMTUtils ends with code 2, which means that it needs a restart to get rid of the last files.

Note: The RunScanState_FullOS.BAT, RunScanState_WinPE.BAT, RunLoadState.BATand the RunUSMTutils.BAT have to be placed inside the USMT Package at the same level as the amd64- and the x86-folder.

More information about the Scanstate Syntax:
http://technet.microsoft.com/en-us/library/dd560781(WS.10).aspx
More information about the LoadState Syntax:
http://technet.microsoft.com/en-us/library/dd560804(WS.10).aspx
More information about the USMTUtils Syntax: http://technet.microsoft.com/en-us/library/dd560799(WS.10).aspx

Share

Using USMTUtils.exe during a Task Sequence with ConfigMgr 2007

As I had a lot of questions about the use of USMTUtils, I decided to devote a new post to this. In my previous post I used USMTUtils to clean up the hard-link statestore location.

USMTUtils is needed to clean up a hard-link statestore, because otherwise the hard-link store cannot be deleted due to a sharing lock. The command-line provided by Technet to do this is usmtutils.exe /rd <storedirectory>. Only this is exactly where the problem starts when running a command like this during a Task Sequence, because this will make the Task Sequence “hang” on the point where it has to delete the hard-link statestore. Taking a look at the SMSTS.log, at this point, will show something similar to this:

<![LOG[Executing command line: Run command line]LOG]!><time="14:56:41.804+-60" date="03-23-2010" component="InstallSoftware" context="" type="1" thread="2904" file="commandline.cpp:805">
<![LOG[]LOG]!><time="14:56:42.148+-60" date="03-23-2010" component="InstallSoftware" context="" type="1" thread="2904" file="runcommandline.cpp:34">
<![LOG[WARNING: This command is going to delete the following list of path(s).]LOG]!><time="14:56:42.195+-60" date="03-23-2010" component="InstallSoftware" context="" type="1" thread="2904" file="runcommandline.cpp:34">
<![LOG[Please review before continuing …]LOG]!><time="14:56:42.195+-60" date="03-23-2010" component="InstallSoftware" context="" type="1" thread="2904" file="runcommandline.cpp:34">

After this I just tried running the command-line manually from a cmd in Windows and this showed the following information:

WARNING: This command is going to delete the following list of path(s).
Please review before continuing …

        C:\<storedirectory>

Are you sure you want to proceed (Y/N)?

The conclusion here is that running the command-line usmtutils.exe /rd <storedirectory> will need a confirmation. This is the point where we have to grab back to a batch-file, so we can pipeline a positive response to the question asked by the USMTUtils. This can be done by using echo y|. So the batch-file, that we need to run the USMTUtils from a Task Sequence (with ConfigMgr 2007), has to include the command-line echo y| usmtutils.exe /rd <storedirectory>.

I hope this post gives a bit more inside information of why it is needed to pipeline a confirmation with the use of USMTUTils.

Share

Capture User Files and Settings in Offline Mode (WinPE) with ConfigMgr 2007

In a previous postI already showed how to do a Hard-Link migration, when started from FullOS. That part still exists in my Task Sequence, but it is now moved under the Group Capture User Files and Settings – FullOS. This part will now only run when the Task Sequence is started from FullOS.

In this post I will add a part to the Task Sequence that makes sure that the User State will also be captured,  HardLinkOfflineTS when the Task Sequence is started from WinPE (also called Offline Mode). The cool part is that it will also be done by/ with using Hard-Links!

Capture User Files and Settings

For creating a Task Sequence, that does an Offline Capture, my way, a few variables and locations need to be created. After that a command line has to be run to do the actual Capture. Under here I will sum up the steps I take to do an Offline Capture (also see the red rectangle in the picture):

  • Set Started in WinPE – Set Task Sequence Variable
    This step sets the Task Sequence Variable TSStartedInWinPE to YES. This Task Sequence Variable only gets set when _SMSTSInWinPE is TRUE.
  • Capture User Files and Settings – WinPE – Group
    This group Captures the User Files and Settings when the machine is started from WinPE. This is done by checking if the Task Sequence Variable TSStartedInWinPE is set to YES.
  • Set Architecture – Set Task Sequence Variable
    This step sets the Task Sequence Variable Architecture to amd64. This variable will be used for selecting the USMT 4.0 version for 64-bit systems.
  • Set Windows Partition – Set Task Sequence Variable
    This step sets the Task Sequence Variable WindowsPartition to C:. This variable will be used for selecting the Windows partition.
  • Set State Store Location – Set Task Sequence Variable
    This step sets the Task Sequence Variable OSDStateStorePath to %WindowsPartition%\StateStore. This variable will be used for creating and selecting the User State Location.
  • Create State Store Location – Run Command Line
    This step creates the directory %WindowsPartition%\StateStore by running the Command line: cmd /c MKDIR %OSDStateStorePath%.
  • Cache USMT Files and Scripts – Run Command Line
    This step caches the USMT Files and Scripts from the USMT Package to the directory %OSDStateStorePath%\USMTFiles\ by running the Command line: xcopy * %OSDStateStorePath%\USMTFiles\ /herciy
  • Capture User Files and Settings – Run Command Line
    This step does the actual Capture of the User Files and Settings by running the Command line RunScanState.BAT %OSDStateStorePath% %WindowsPartition% %Architecture% which has to start in the directory %OSDStateStorePath%\USMTFiles\.

These are all the steps I need, to do an Offline Capture with Hard-Links. Now let’s take a closer look at the batch-file which does most of the work.

REM ============================================================
REM VARIABLE -1- OSDStateStorePath = %1
REM VARIABLE -2- WindowsPartition = %2
REM VARIABLE -3- Architecture = %3
REM ============================================================

SET USMT_WORKING_DIR=%1\USMTFiles\%3

REM ============================================================
REM RUN Scanstate
REM ============================================================

“%1\USMTFiles\%3\Scanstate.exe” “%1” /o /hardlink /nocompress /i:%1\USMTFiles\%3\miguser.xml i:%1\USMTFiles\%3\migapp.xml /offilinewindir:%2\Windows\TEMP\SMSTSLog\Scanstate.log /v:5 /progress:%2\Windows\TEMP\SMSTSLog\Scanstateprogress.log /c /efs:hardlink

REM ============================================================
REM EXIT Errorlevel
REM ============================================================

EXIT /b %errorlevel%

In this batch-file I am using three variables which are being set during the Task Sequence (and explained in the batch). The Scanstate command line, that is being used, is completely based on the standard syntax. Under here I created a table in which can be seen what every part of my command line stands for.

Command What does it do…
%1\USMTFiles\%3\scanstate.exe Scanstate.exe
%1 Specifies the folder where files and settings will be saved
/o Enables the possibility to overwrite existing data in de Migration Store.
/hardlink Enables the creation of a Hard-Link Migration Store
/nocompress Disables the compression of data.
/i:%1\USMTFiles\%3\miguser.xml Specifies an .xml file that contains rules that define what user, application or system state to migrate
/i:%1\USMTFiles\%3\migapp.xml Specifies an .xml file that contains rules that define what user, application or system state to migrate
/offlinewindir:%2\windows Specifies the Offline Windows directory that the ScanState command gathers user state from
/l:%2\windows\TEMP\SMSTSLog\Scanstate.log Specifies the location and name of the ScanState log
/v:5 Enables the verbose output in the ScanState log file
/progress:%2\windows\TEMP\SMSTSLog\Scanstateprogress.log Specifies the location and name of the ScanState progress log
/c Enables the ScanState command to continue to run, even if non-fatal errors occur
/efs:hardlink Enables the migration of encrypted files by creating a Hard-Link to the EFS file instead of copying it

Restore User Files and Settings

After the User Files and Settings have been captured, they need to be restored again to the new OS. For this I use the default Restore User Files and Settings step from ConfigMgr 2007 and the variable OSDMigrateAdditionalRestoreOptions. This variable is filled with the options /nocompress /hardlink, see for this also my previous post. This default step will restore everything that is found in the State Store Location.

With the red arrow in the picture I point at another important step (which is often forgotten). This step is the Cleanup User State Location, a Run Command Line step from ConfigMgr 2007. This step cleans up the State Store Location by running the command line RunUSMTutils.BAT %OSDStateStorePath% %Architecture% from the USMT 4.0 Package.

Now let’s take a look at the batch-file which does most of the work here.

REM ============================================================
REM VARIABLE -1- OSDStateStorePath = %1
REM VARIABLE -2- Architecture = %2
REM ============================================================

REM ============================================================
REM RUN USMTUtils
REM ============================================================

echo y| “%~dp0%2\usmtutils.exe” /rd “%1”

REM ============================================================
REM EXIT Errorlevel
REM ============================================================

EXIT /b %errorlevel%

The important part in here is the echo y|, because only running umstutils.exe /rd will ask for a confirmation on the action. I have to say that I really missed this in the documentation! So just use echo y| to pipeline a positive response on the confirmation, asked by the usmtutils.

Note: The RunScanState.BAT and the RunUSMTutils.BAT have to be placed inside the USMT Package at the same level as the amd64- and the x86-folder.

More information about the Scanstate Syntax:
http://technet.microsoft.com/en-us/library/dd560781(WS.10).aspx
More information about the LoadState Syntax:
http://technet.microsoft.com/en-us/library/dd560804(WS.10).aspx
More information about the USMTUtils Syntax: http://technet.microsoft.com/en-us/library/dd560799(WS.10).aspx

Share

User Driven OS Deployment with “Modena”

It took a while but this weekend it was finally time for some testing of, what’s code-named, “Modena”. Modena is a tool, developed by Microsoft IT, that enables the ability of an End-User Experience by using a powerful OSD Wizard.

ModWelcWhen you are searching for a way to get your users “involved” in an OS Deployment, then I would recommend you to take a look at Modena. The OSD Wizard of Modena (see picture) can be changed in a lot of different way’s. As an administrator you can select which settings can be done by a user and which are pre-set. By these customizable settings you can think about things like computername, domain, local administrators, language, time, image, backup (via USMT 4.0) and the applications. The nice thing about the applications is that you can first do a scan of the computer to see what applications are currently installed. Based on the results of this scan, applications can get pre-selected (or not). Besides al of these settings Modena also provides a better insight in what is happening with the computer during the Task Sequence.

To make a long story short, take a look at Microsoft Connect to get Modena: 
>> https://connect.microsoft.com/site868 <<

Also take a look at the following links for setting up Modena…
1. Getting started with Modena – Step 1 – Installing Modena: http://blogs.technet.com/osd/archive/2009/12/15/getting-started-with-modena-step-1-installing-modena-rc2.aspx
2. Getting started with Modena – Step 2 – Create OSD Packages: http://blogs.technet.com/osd/archive/2009/12/16/getting-started-with-modena-step-2-create-osd-packages.aspx
3. Getting started with Modena – Step 3 – Importing Task Sequences: http://blogs.technet.com/osd/archive/2009/12/17/getting-started-with-modena-step-3-importing-task-sequence.aspx
4. Getting started with Modena – Step 4 –Introduction to OSD Designer: http://blogs.technet.com/osd/archive/2009/12/17/getting-started-with-modena-step-4-introduction-to-osd-designer.aspx
5. Getting started with Modena – Step 5 – Using Modena Online Services: http://blogs.technet.com/osd/archive/2009/12/18/getting-started-with-modena-step-5-using-modena-online-services.aspx
6. Getting started with Modena – Step 6 – Setting Up Applications: http://blogs.technet.com/osd/archive/2009/12/28/getting-started-with-modena-step-6-setting-up-applications.aspx

…and take a look at these links for the story behind Modena.
General Cravings of OSD: http://blogs.technet.com/osd/
Windows 7 Deployment Guide: http://technet.microsoft.com/en-us/magazine/ee676738.aspx

Share

ConfigMgr 2007, USMT 4.0 and using Hard-Links

One of the coolest new functions of USMT 4.0 is the new hard-link migration store (only for computer-refresh scenarios). These migration stores are stored locally on the computer that is being refreshed and can migrate user accounts, files and settings. This way it will save time and space during a computer-refresh (and you do not need a State Migration Point!). HardLinkTS

When you create a default Task Sequence it will create the steps Request User State Storage and Release User State Storage. These steps are needed to interact with the State Migration Point (SMP) to get available space and to tell that the action completed successfully. So these steps are not needed anymore when you are using hard-links! This is why these steps are grayed out in the picture. Instead we need to define three variables:

  1. OSDStateStorePath: Defines the path to the user state store. This path must be on a local drive. As path I use the value:    %_SMSTSUserStatePath%. This Task Sequence Variable must be set before the step: Capture User Files and Settings.
  2. OSDMigrateAdditionalCaptureOptions: Specifies the extra options needed to perform a hard-link migration capture and must include /nocompress /hardlink. This Task Sequence Variable must be set before the step: Capture User Files and Settings.
  3. OSDMigrateAdditionalRestoreOptions: Specifies the extra options needed to perform a hard-link migration restore and must include /nocompress /hardlink. This Task Sequence Variable must be set before the step: Restore User Files and Settings.

The picture with this post shows a plain and simple example about how a Task Sequence could look with hard-links enabled. In the red rectangles I created my Task Sequence Variables and the still needed steps of Capture User Files and Settings and Restore User Files and Settings. Because I still use these default ConfigMgr 2007 steps it is not possible to run the capture in WinPE.

More information about USMT 4.0:
http://technet.microsoft.com/en-us/library/dd560752(WS.10).aspx
More information about USMT 4.0 Hard-Link Migration: http://technet.microsoft.com/en-us/library/dd939980(WS.10).aspx
More information about How to use Hard-Links for User State Migration: http://technet.microsoft.com/ja-jp/library/ee344267.aspx

Share