LoadState.exe command is used with the User State Migration Tool (USMT) 10.0 to restore a store previously captured by the
ScanState.exe command onto a destination computer. This article discusses the
LoadState.exe command syntax and the options available with it.
Before you begin
Before you run the
LoadState.exe command, note the following items:
To ensure that all operating system settings migrate, we recommend that you run the
LoadState.execommands in administrator mode from an account with administrative credentials.
For information about software requirements for running the
LoadState.execommand, see USMT requirements.
You should sign out after you run the
LoadState.execommand. Some settings, such as example, fonts, wallpaper, and screensaver settings, won't 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 doesn't require domain controller access to apply domain profiles. This functionality is available without any additional configuration. It isn't 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.
This section explains the syntax and usage of the command-line options available when you use the
LoadState.exe command. The options can be specified in any order. If the option contains a parameter, you can specify either a colon or space separator.
LoadState.exe command's syntax is:
LoadState.exe 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, type the following command:
LoadState.exe \\server\share\migration\mystore /i:MigApp.xml /i:MigDocs.xml /v:13 /decrypt /key:"mykey"
USMT provides the following options that you can use to specify how and where the migrated data is stored.
|StorePath||Indicates the folder where the files and settings data are stored. You must specify StorePath when using the
/decrypt /key:"Key String"
|Decrypts the store with the specified key. With this option, you'll need to specify the encryption key in one of the following ways:
KeyString can't exceed 256 characters.
Use caution when using the
|/hardlink||Enables user-state data to be restored from a hard-link migration store. The
|/nocompress||Specifies that the store isn't compressed. You should only use this option in testing environments. We recommend that you use a compressed store during your actual migration. This option can't be used with the
Migration rule options
USMT provides the following options to specify what files you want to migrate.
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 (
For more information about which files to specify, see the "XML files" section of the Frequently Asked Questions article.
This example migrates the files and settings based on the rules in the
|/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
USMT provides several command-line options that you can use to analyze problems that occur during migration.
|/l:[Path]FileName||Specifies the location and name of the LoadState log. You can't store any of the log files in StorePath. Path can be either a relative or full path. If you don't specify the Path variable, then the log will be created in the current directory. You can specify the
If you run the
USMT was unable to create the log file(s)
To fix this issue, make sure to specify the
Enables verbose output in the LoadState log file. The default value is 0.
You can set the VerbosityLevel to one of the following levels:
|/progress:[Path]FileName||Creates the optional progress log. You can't store any of the log files in StorePath. Path can be either a relative or full path. If you don't specify the Path variable, then FileName will be created in the current directory.
|/c||When this option is specified, the
Specifies the number of times to retry when an error occurs while migrating the user state from a server. The default is three times. This option is useful in environments where network connectivity isn't reliable.
While restoring the user state, the
Specifies the time to wait, in seconds, before retrying a network file operation. The default is 1 second.
|/? or /help||Displays Help on the command line.|
By default, all users are migrated. The only way to specify which users to include and exclude is by using the following options. You can't exclude users in the migration .xml files or by using the
Config.xml file. For more information, see Identify Users.
|/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
/ui:"DomainName User Name"
Migrates the specified user. By default, all users are included in the migration. Therefore, this option is helpful only when used with the
For example, to include only User2 from the Corporate domain, enter:
If a user is specified for inclusion with the
For more examples, see the descriptions of the
|(User exclude based on last logon)
Migrates only the users that logged onto the source computer within the specified time period, based on the Last Modified date of the Ntuser.dat file on the source computer. The
/ue "DomainName\User Name"
Excludes the specified users from the migration. You can specify multiple
For more examples, see the descriptions of the
Specifies a new domain for the user. Use this option to change the domain for users on a computer or to migrate a local user to a domain account. OldDomain may contain the asterisk () wildcard character.
You can specify this option more than once. You may want to specify multiple
If there are conflicts between two
If you specify an OldDomain that didn't exist on the source computer, the
Specifies a new user name for the specified user. If the store contains more than one user, you can specify multiple
|/lac:[Password]||(Local account create)
Specifies that if a user account is a local (non-domain) account, and it doesn't exist on the destination computer, USMT will create the account on the destination computer but it will be disabled. To enable the account, you must also use the
Password is the password for the newly created account. An empty password is used by default.
Use the Password variable with caution because it's provided in plain text and can be obtained by anyone with access to the computer that is running the
Also, if the computer has multiple users, all migrated users will have the same password.
For instructions, see Migrate user accounts.
||(Local account enable)
Enables the account that was created with the
For instructions, see Migrate user accounts.
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.
|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.||
Using the options together
You can use the
/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 included using the
/ui option and also excluded using either the
/uel options, the user will be included in the migration. For example, if you specify
/ui:contoso\* /ue:contoso\user1, then User1 will be migrated, because the
/ui option takes precedence over the
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're excluded by using the
/ue option. For example, if you specify
/ue:contoso\user1 /uel:14, the User1 will be migrated if they've logged on to the computer within the last 14 days.
|Include only User2 from the Fabrikam domain and exclude all other users.||
|Include only the local user named User1 and exclude all other users.||
|Include only the domain users from Contoso, except Contoso\User1.||This behavior can't be completed using a single command. Instead, to migrate this set of users, you'll need to specify the following options:
|Include only local (non-domain) users.||
Incompatible command-line options
The following table indicates which command-line options aren't compatible with the
LoadState.exe 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 aren't compatible. For example, you can't use the
/nocompress option with the
You must specify either the
/keyfile option with the