LoadState Syntax
In this topic
- Before you begin
- Syntax
- Storage options
- Migration rule options
- Monitoring options
- User options
- Command-line option incompatibility
Before you begin
Before you run LoadState, note the following:
- When running ScanState and LoadState on Windows Vista, you need to run the tools in “Administrator” mode from an account with administrative credentials to ensure that all specified users are migrated. This is because User Access Control (UAC) is turned on in Windows Vista. To run in this mode, click the start button, click All Programs, click Accessories, right-click Command Prompt, click Run as administrator, and then specify your LoadState or ScanState command. If you do not run USMT in “Administrator” mode, only the user profile that is logged on will be included in the migration.
- You should log off after you run LoadState. Some settings (for example, fonts, wallpaper, and screensaver settings) will not take effect until the next time the user logs in.
- You need to be a local or domain administrator to run LoadState unless you specify the /q option.
- Unless otherwise specified, you can only specify each option once on the command line.
- The Command-line option incompatibility diagram shows which options you can use together.
Syntax
This section explains the syntax and usage of the LoadState command-line options. 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 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\]UserName]|LocalUserName] [/ue:[[DomainName\]UserName]|LocalUserName] [/uel:NumberOfDays|YYYY/MM/DD|0] [/md:OldDomain:NewDomain] [/mu:OldDomain\OldUserName:[NewDomain\]NewUserName] [/lac:[Password]] [/lae] [/q] [/config:[Path\]FileName] [/?|help]
For example:
- To decrypt the store and migrate the files and settings to a computer running Windows Vista, specify:
loadstate \\fileserver\migration\mystore /i:migapp.xml /i:miguser.xml /v:13 /decrypt /key:"mykey" - To decrypt the store and migrate the files and settings to a computer running Windows XP, specify:
loadstate \\fileserver\migration\mystore /i:migsys.xml /i:migapp.xml /i:miguser.xml /v:13 /decrypt /key:"mykey"
Storage options
USMT 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 on the LoadState command line. 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 with one of the following ways:
KeyString cannot exceed 256 characters. /key and /keyfile cannot be used on the same command line. /decrypt and /nocompress cannot be used on the same command line.
For example: loadstate /i:miguser.xml /i:miguser.xml \\fileserver\migration\mystore /decrypt /key:mykey |
||
/nocompress |
Specifies that the store is not compressed. You should only use this option in testing environments because we recommend that you use a compressed store during your actual migration. This option cannot be used in with the /decrypt option. For example: loadstate /i:miguser.xml /i:miguser.xml \\fileserver\migration\mystore /nocompress |
Migration rule options
USMT provides the following option that you can use to specify what 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 in order to specify all of your .xml files (MigApp.xml, MigSys.xml, MigUser.xml and any custom .xml files that you create). Path can be a relative or full path. If you do not specify Path, 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. |
/q | Allows LoadState to run without administrative credentials. This option will only migrate the settings and account for the user who is currently logged on. Errors will occur if you try to apply settings to a location for which the user does not have sufficient credentials. For example, you will receive an error if a file needs to be written to "C:\Program Files" and the user you are running LoadState under does not have sufficient credentials to that folder. |
/config:[Path\]FileName | Specifies the Config.xml file that LoadState should use. You cannot specify this option more than once on the command line. Path can be a relative or full path. If you do not specify Path, then FileName must be located in the current directory. This example migrates the files and settings based on the rules in Config.xml, MigUser.xml, and MigApp.xml: loadstate \fileserver\migration\mystore /config:config.xml /i:miguser.xml /i:migapp.xml /v:13 /l:loadstate.log |
Monitoring options
USMT provides several 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 a relative or full path. If you do not specify Path, then the log will be created in the current directory. You can specify /v to adjust the amount of output.
|
/progress:[Path\]FileName | Creates the optional progress log. You cannot store any of the log files in StorePath. Path can be a relative or full path. If you do not specify Path, then FileName will be created in the current directory.
|
/c | When specified, LoadState will continue to run even if there are nonfatal errors. Without the /c option, LoadState exits on the first error. When you specify this option, any files or settings that cause an error and are ignored will be logged in the progress log. For example, if a file is open or if there is a large file that will not fit on the destination computer, LoadState will log an error and will continue with the migration. |
/r:TimesToRetry | (Retry)
|
/w:SecondsBeforeRetry | (Wait)
|
/v:VerbosityLevel | (Verbosity)
For example: loadstate \\fileserver\migration\mystore /v:13 /i:migapp.xml /i:miguser.xml |
VerbosityLevel can be one of the following levels:
Level | Binary Value | Explanation |
---|---|---|
0 |
0000 |
Only the default errors and warnings are enabled. |
1 |
0001 |
Enables verbose output. |
4 |
0100 |
Enables error and status output. |
5 |
0101 |
Enables verbose and status output. |
8 |
1000 |
Enables error output to a debugger. |
9 |
1001 |
Enables verbose output to a debugger. |
12 |
1100 |
Enables error and status output to a debugger. |
13 |
1101 |
Enables verbose, status, and debugger output. |
If you specify 2, 3, 6, 7, 10, 11, 14, or 15, USMT uses the following mapping to determine VerbosityLevel.
Specified Level | Binary Value | Implied Level |
---|---|---|
2 |
0010 |
0 |
3 |
0011 |
1 |
6 |
0110 |
4 |
7 |
0111 |
5 |
10 |
1010 |
8 |
11 |
1011 |
9 |
14 |
1110 |
12 |
15 |
1111 |
13 |
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 Config.xml. For more information, see Identify Users.
Option | Description |
---|---|
/all |
Migrates all of the users on the computer.
|
/ui:DomainName\UserName
|
(User include)
For more examples, see /uel, /ue, and /ui examples. |
/uel:NumberOfDays
|
(User exclude based on last logon)
Note USMT excludes users based on the state of the computer when ScanState was run. For example, if a user logs onto the source computer after ScanState is run but before LoadState is run, the logon will not be considered in this option.
loadstate /i:migapp.xml /i:miguser.xml \fileserver\migration\mystore /uel:0
|
/ue:DomainName\UserName
|
(User exclude)
|
/md:OldDomain:NewDomain
|
(move domain)
Note If you specify an OldDomain that did not exist on the source computer, LoadState will appear to complete successfully (without an error or warning). However, in this case, user(s) will not be moved to NewDomain but will remain in their original domain. For example, if you miss-spell "domain1" and you specify "/md:domai1:domain2", the user(s) will remain in domain1 on the destination computer.
|
/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 You should use Password with caution because it is provided in plain text and can be obtained by anyone with access to the computer that is running LoadState. Also, if the computer has multiple users, all migrated users will have the same password.
|
/lae |
(local account enable)
|
/ue, and /ui examples
Examples for /ui and /ue.
The following examples apply to both /ui and /ue. That is, you can replace /ue with /ui to specify to include rather than exclude the specified users.
Behavior | Command |
---|---|
Exclude the user named User One in the Fareast domain. |
/ue:fareast\"user one" |
Exclude the user named User1 in the Fareast domain. |
/ue:fareast\user1 |
Exclude the local user named User1. |
/ue:user1 |
Exclude all local and domain users. |
/ue:*\* |
Exclude all local users. |
/ue:* |
Exclude users in all domains named User1, User2, and so on. |
/ue:*\user* |
Using the options together
You can use /uel, /ue, and /ui together in order to migrate only the users that you want migrated. However, if a user is specified with /ui, and also specified to exclude with either /ue or /uel, the user will be included in the migration. For example if you specify /ui:domain1\* /ue:domain1\user1, then User1 will be migrated because /ui takes precedence.
Behavior | Command |
---|---|
Include only User2 from the Fareast domain and exclude all other users. |
/ue:*\* /ui:fareast\user2 |
Include only the local user named User1 and exclude all other users. |
/ue:*\* /ui:user1 |
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. |
/ue:*\* /ui:* |
Include only users. |
/ue:*\* /ui:* |
Command-line option incompatibility
The following tables indicate which command-line options are not compatible on the LoadState command line. 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 /decrypt option.