LoadState Syntax
Applies To: Windows 7, Windows Vista
This topic discusses the LoadState command syntax and options.
In This Topic
Before You Begin
Syntax
Storage Options
Migration Rule Options
Monitoring Options
User Options
Incompatible Command-Line Options
Before You Begin
Before you run the LoadState command, note the following:
When running the ScanState and LoadState commands on Windows Vista® or Windows® 7, you need to run the tools in administrator mode from an account with administrative credentials.
You should log off after you run the LoadState command. Some settings (for example, fonts, wallpaper, and screensaver settings) will not take effect until the next time the user logs in.
Unless otherwise specified, you can use each option only once when running a tool on the command line.
LoadState does not require domain controller access to apply domain profiles. This functionality is available without any additional configuration. It is not necessary for the source computer to have had domain controller access when the user profile was gathered using ScanState. However, domain profiles are inaccessible until the destination computer is joined to the domain.
The Incompatible Command-Line Options table lists which options you can use together and which command-line options are incompatible.
Syntax
This section explains the syntax and usage of the command-line options available when you use the LoadState command. The options can be specified in any order. If the option contains a parameter, you can specify either a colon or space separator.
The LoadState command's syntax is:
loadstate StorePath [/i:[Path\]FileName] [/v:VerbosityLevel] [/nocompress] [/decrypt /key:KeyString|/keyfile:[Path\]FileName] [/l:[Path\]FileName] [/progress:[Path\]FileName] [/r:TimesToRetry] [/w:SecondsToWait] [/c] [/all] [/ui:[DomainName|ComputerName\]UserName] [/ue:[[DomainName|ComputerName\]UserName] [/uel:NumberOfDays|YYYY/MM/DD|0] [/md:OldDomain:NewDomain] [/mu:OldDomain\OldUserName:[NewDomain\]NewUserName] [/lac:[Password]] [/lae] [/config:[Path\]FileName] [/?|help]
For example, to decrypt the store and migrate the files and settings to a computer running Windows Vista or Windows 7, type the following on the command line:
loadstate \\fileserver\migration\mystore /i:migapp.xml /i:miguser.xml /v:13 /decrypt /key:"mykey"
Storage Options
USMT 4.0 provides the following options that you can use to specify how and where the migrated data is stored.
Option | Description | ||
---|---|---|---|
StorePath |
Indicates the folder where the files and settings data are stored. You must specify StorePath when using the LoadState command. You cannot specify more than one StorePath. |
||
/decrypt/key:KeyString or /decrypt/key:"Key String" or /decrypt/keyfile:[Path\]FileName |
Decrypts the store with the specified key. With this option, you will need to specify the encryption key in one of the following ways:
KeyString cannot exceed 256 characters. The /key and /keyfile options cannot be used on the same command line. The /decrypt and /nocompress options cannot be used on the same command line.
For example:
|
||
/decrypt:"encryption strength" |
The /decrypt option accepts a command-line parameter to define the encryption strength specified for the migration store encryption. For more information about supported encryption algorithms, see Migration Store Encryption. |
||
/hardlink |
Enables user-state data to be restored from a hard-link migration store. The /nocompress parameter must be specified with /hardlink option. |
||
/nocompress |
Specifies that the store is not compressed. You should only use this option in testing environments. We recommend that you use a compressed store during your actual migration. This option cannot be used with the /decrypt option. For example:
|
Migration Rule Options
USMT 4.0 provides the following options to specify what files you want to migrate.
Option | Description |
---|---|
/i:[Path\]FileName | (include) Specifies an .xml file that contains rules that define what state to migrate. You can specify this option multiple times to include all of your .xml files (MigApp.xml, MigSys.xml, MigUser.xml and any custom .xml files that you create). Path can be either a relative or full path. If you do not specify the Path variable, then FileName must be located in the current directory. For more information about which files to specify, see the "XML files" section of the Frequently Asked Questions topic. |
/config:[Path\]FileName |
Specifies the Config.xml file that the LoadState command should use. You cannot specify this option more than once on the command line. Path can be either a relative or full path. If you do not specify the Path variable, then the FileName must be located in the current directory. This example migrates the files and settings based on the rules in the Config.xml, MigUser.xml, and MigApp.xml files:
|
/auto:"path to script files" |
This option enables you to specify the location of the default .xml files and then launch your migration. If no path is specified, USMT will use the directory where the USMT binaries are located. The /auto option has the same effect as using the following options: /i:MigDocs.xml/i:MigApp.xml /v:13. |
Monitoring Options
USMT 4.0 provides several command-line options that you can use to analyze problems that occur during migration.
Option | Description | ||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
/l:[Path\]FileName |
Specifies the location and name of the LoadState log. You cannot store any of the log files in StorePath. Path can be either a relative or full path. If you do not specify the Path variable, then the log will be created in the current directory. You can specify the /v option to adjust the amount of output. If you run the LoadState command from a shared network resource, you must specify this option or USMT will fail with the error: "USMT was unable to create the log file(s)". To fix this issue, use the /l:load.log option. | ||||||||||||||||||||||||||||||||||
/v:VerbosityLevel | (Verbosity) Enables verbose output in the ScanState log file. The default value is 0. You can set the VerbosityLevel to one of the following levels:
For example:
| ||||||||||||||||||||||||||||||||||
/progress:[Path\]FileName |
Creates the optional progress log. You cannot store any of the log files in StorePath. Path can be either a relative or full path. If you do not specify the Path variable, then FileName will be created in the current directory. For example:
| ||||||||||||||||||||||||||||||||||
/c |
When this option is specified, the LoadState command will continue to run, even if non-fatal errors occur. Any files or settings that cause an error are logged in the progress log. For example, if there is a large file that will not fit on the computer, the LoadState command will log an error and continue with the migration. Without the /c option, the LoadState command will exit on the first error.You can use the new <ErrorControl\> section in the Config.xml file to specify which file or registry read/write errors can be safely ignored and which might cause the migration to fail. This enables the /c command-line option to safely skip all input/output (I/O) errors in your environment. In addition, the /genconfig option now generates a sample \<ErrorControl\> section that is enabled by specifying error messages and desired behaviors in the Config.xml file. | ||||||||||||||||||||||||||||||||||
/r:TimesToRetry | (Retry)
| ||||||||||||||||||||||||||||||||||
/w:SecondsBeforeRetry | (Wait)
| ||||||||||||||||||||||||||||||||||
/? or /help |
Displays Help on the command line. |
User Options
By default, all users are migrated. The only way to specify which users to include and exclude is by using the following options. You cannot exclude users in the migration .xml files or using the Config.xml file. For more information, see Identify Users.
Option | Description |
---|---|
/all |
Migrates all of the users on the computer. USMT migrates all user accounts on the computer, unless you specifically exclude an account with the /ue or /uel options. For this reason, you do not need to specify this option on the command line. However, if you choose to use the /all option, you cannot also use the /ui, /ue or /uel options. |
/ui:DomainName\UserName or /ui:"DomainName\User Name" or /ui:ComputerName\LocalUserName |
(User include) Migrates the specified user. By default, all users are included in the migration. Therefore, this option is helpful only when used with the /ue option. You can specify multiple /ui options, but you cannot use the /ui option with the /all option. DomainName and UserName can contain the asterisk (*) wildcard character. When you specify a user name that contains spaces, you will need to surround it with quotations marks. For example:
For more examples, see the descriptions of the /uel, /ue, and /ui options in this table. |
/uel:NumberOfDays
|
(User exclude based on last logon)
Note The /uel option is not valid in offline migrations.
Examples:
For example:
|
/ue:DomainName\UserName or
/ue:ComputerName\LocalUserName |
(User exclude)
|
/md:OldDomain:NewDomain
|
(move domain)
Note If you specify an OldDomain that did not exist on the source computer, the LoadState command will appear to complete successfully, without an error or warning. However, in this case, users will not be moved to NewDomain but will remain in their original domain. For example, if you misspell "domain1" and you specify "/md:domai1:domain2", the users will remain in domain1 on the destination computer.
For example:
|
/mu:OldDomain\OldUserName:[NewDomain\]NewUserName
|
Specifies a new user name for the specified user. If the store contains more than one user, you can specify multiple /mu options. You cannot use wildcard characters with this option.
|
/lac:[Password] |
(local account create)
Warning Use the Password variable with caution because it is provided in plain text and can be obtained by anyone with access to the computer that is running the LoadState command.
For example:
|
/lae |
(local account enable)
|
Examples for the /ui and /ue options
The following examples apply to both the /ui and /ue options. You can replace the /ue option with the /ui option to include, rather than exclude, the specified users.
Behavior | Command |
---|---|
Exclude the user named User One in the Corporate domain. |
|
Exclude the user named User1 in the Corporate domain. |
|
Exclude the local user named User1. |
|
Exclude all domain users. |
|
Exclude all local users. |
|
Exclude users in all domains named User1, User2, and so on. |
/ue:*\user* |
Using the Options Together
You can use the /uel, /ue and /ui options together to migrate only the users that you want migrated.
The /ui option has precedence over the /ue and /uel options. If a user is specified to be included using the /ui option, and also specified to be excluded using either the /ue or /uel options, the user will be included in the migration. For example, if you specify /ui:domain1\* /ue:domain1\user1
, then User1 will be migrated, because the /ui option takes precedence over the /ue option.
The /uel option takes precedence over the /ue option. If a user has logged on within the specified time period set by the /uel option, that user’s profile will be migrated even if they are excluded by using the /ue option. For example, if you specify /ue:domain1\user1 /uel:14
, the User1 will be migrated if they have logged on to the computer within the last 14 days.
Behavior | Command |
---|---|
Include only User2 from the FarWest domain and exclude all other users. |
|
Include only the local user named User1 and exclude all other users. |
|
Include only the domain users from Domain1, except Domain1\User1. |
This behavior cannot be completed using a single command. Instead, to migrate this set of users, you will need to specify the following:
|
Include only local (non-domain) users. |
|
Incompatible Command-Line Options
The following table indicates which command-line options are not compatible with the LoadState command. If the table entry for a particular combination is blank, the options are compatible and you can use them together. The X symbol means that the options are not compatible. For example, you cannot use the /nocompress option with the /encrypt option.
Command-Line option | /keyfile | /nocompress | /genconfig | /all |
---|---|---|---|---|
/i |
||||
/v |
||||
/nocompress |
N/A |
X |
||
/key |
X |
X |
||
/decrypt |
Required* |
X |
X |
|
/keyfile |
N/A |
X |
||
/l |
||||
/progress |
X |
|||
/r |
X |
|||
/w |
X |
|||
/c |
X |
|||
/p |
X |
N/A |
||
/all |
X |
|||
/ui |
X |
X |
||
/ue |
X |
X |
||
/uel |
X |
X |
||
/genconfig |
N/A |
|||
/config |
X |
|||
StorePath |
||||
/md |
||||
/mu |
||||
/lae |
||||
/lac |
Note
You must specify either the /key or /keyfile option with the /encrypt option.