How the settings in ConfigMgr translate to the command line in USMT

The last couple of days I’ve seen and read a few situations in which it was clear that it’s not always that obvious what the USMT command line will be based on the settings in ConfigMgr. This blog post will be about the different settings in a task sequence for capturing and restoring the user state and how they translate to the command line for USMT.

Capture User State

CaptureLet’s start with two basic capture settings and continue from there. These basic settings are Capture all user profiles by using standard options and Copy by using file system access. These settings combine to a command line like this C:\_SMSTaskSequence\Packages\PCP00001\amd64\scanstate.exe C:\_SMSTaskSequence\UserState /o /localonly /efs:copyraw /l:C:\WINDOWS\CCM\Logs\SMSTSLog\scanstate.log /progress:C:\WINDOWS\CCM\Logs\SMSTSLog\scanstateprogress.log /i:C:\_SMSTaskSequence\Packages\PCP00001\amd64\migdocs.xml /i:C:\_SMSTaskSequence\Packages\PCP00001\amd64\migapp.xml.

Based on that command line we can see that by default it will overwrite any existing data in the migration store (/o) and it will only migrate data from the local computer (/localonly). Also, it does standard things like using log files (/l and /progress) and using standard configuration files (/i). The following table lists the adjustments to this command line when selecting different options in the task sequence editor.

Option Command
Enable verbose logging /v:5
Skip files that use the Encrypting File System /efs:skip
Continue if some files cannot be captured /c
Capture locally by using links instead of copying files /hardlink /nocompress
Capture in off-line mode (Windows PE only) /offlineWinDir:D:\WINDOWS
Capture by using Volume Copy Shadow Services (VSS) /vsc
Customize how user profiles are captured /i:D:\_SMSTaskSequence\Packages\PCP00001\x86\Example1.xml
/i:D:\_SMSTaskSequence\Packages\PCP00001\x86\Example2.xml

Restore User State

RestoreLet’s start with one basic restore setting and continue from there. This basic setting is Restore all captured user profiles with standard options. This setting translates to a command line like this C:\_SMSTaskSequence\Packages\PCP00001\amd64\loadstate.exe C:\_SMSTaskSequence\UserState /l:C:\WINDOWS\CCM\Logs\SMSTSLog\loadstate.log /progress:C:\WINDOWS\CCM\Logs\SMSTSLog\loadstateprogress.log /i:C:\_SMSTaskSequence\Packages\PCP00001\amd64\migdocs.xml /i:C:\_SMSTaskSequence\Packages\PCP00001\amd64\migapp.xml

Based on that command line we can see that by default it does standard things like using log files (/l and /progress) and using standard configuration files (/i). The following table lists the adjustments to this command line when selecting different options in the task sequence editor.

Option Command
Continue if some files cannot be restored /c
Restore local computer user profiles /lae /lac:Password01
Enabled verbose logging /v:5
Customize how user profiles are restored /i:C:\_SMSTaskSequence\Packages\PCP00001\amd64\Example1.xml
/i:C:\_SMSTaskSequence\Packages\PCP00001\amd64\Example2.xml

Extra options

Somebody familiar with USMT might notice that this doesn’t even cover half of the settings available for USMT. The nice thing is that it’s also possible to use these other command line switches. There are three task sequence variables that give extra options during the capturing and restoring of user state.

  1. OSDStateStorePath – Specify the UNC or local path name of the folder where the user state is saved. My personal preference is a folder out-side the task sequence cache, like %SystemDrive%\UserState.
  2. OSDMigrateAdditionalCaptureOptions – Specify additional USMT command line options that are used when capturing the user state. This could be used to exclude accounts from the migration, by using one of the /ue command line options.
  3. OSDMigrateAdditionalRestoreOptions – Specifies additional USMT command line options that are used when restoring the user state. This could be used to exclude accounts from the migration, by using one of the /ue command line options.

More information about the task sequence action variables, see: http://technet.microsoft.com/en-us/library/hh273365.aspx
More information about the USMT command line options, see: http://technet.microsoft.com/en-us/library/hh825175.aspx

Share

1 thought on “How the settings in ConfigMgr translate to the command line in USMT

Leave a Comment