How to run Microsoft USMT remotely over a network connection

Microsoft USMT (User State Migration Tool) is a proven and powerful tool that allows a PC administrator to package a Windows Account Profile into a single file to be moved to another PC or backed up. One of the main benefits of this tool is that profiles are moved safely and includes all settings, files, shortcuts, etc.

One of the main drawbacks of USMT is that you have to log into each PC you want to back-up or restore and manually run the USMT application via command line (or script). This article outlines a way to run USMT remotely over a network connection in a way that an end-user will not even notice.

Quick Overview

Below is high level overview of what needs to happen

Backup:

  1. USMT must be invoked on the remote PC.
  2. The script that invoked USMT must detect when it has finished.
  3. The User Account Profile file generated by USMT must be copied to its destination.

Restore:

  1. The User Account Profile file generated by USMT on the previous PC must be copied to this PC.
  2. USMT must be invoked on the remote PC.
  3. The script that invoked USMT must detect when it has finished.

Example Code

Backup:

#Modify this:
$PCToBackUp  = "DESKTOP-47HJ43"

Invoke-Command -ComputerName $PCToBackUp -ScriptBlock {

    #Modify these:
    $ProfileName = "CONTOSO\john"
    $PathToUSMT  = "\\server\usmt"
    $StorePath   = "\\server\migrationstore"

    #Begin Script
    $USMTArgs  = "$StorePath /config:config.xml /i:migdocs.xml /i:migapp.xml /ui:$ProfileName"
    Start-Process -FilePath "PathToUSMT\scanstate.exe" -ArgumentList $USMTArgs -Wait

}

Restore:

#Modify this:
$PCToBackUp  = "DESKTOP-K59D35"

Invoke-Command -ComputerName $PCToBackUp -ScriptBlock {

    #Modify these:
    $ProfileName = "CONTOSO\john"
    $PathToUSMT  = "\\server\usmt"
    $StorePath   = "\\server\migrationstore"

    #Begin Script
    $USMTArgs  = "$StorePath /i:migapp.xml /i:migdocs.xml /ui:$ProfileName"
    Start-Process -FilePath "PathToUSMT\loadstate.exe" -ArgumentList $USMTArgs -Wait

}

Is there a better way?

Yes! There are many GUI (Graphical User Interface) applications that exist that can perform remote profile migrations.

Super GrateUSMT GUIPCmover Express
Windows 7-11 Support
Transfer user accounts
Transfer applications
Transfer over the network❌ Requires additional purchase
Open Source
Portable (no installation necessary)Unknown
Change user domain
Change user name
Delete user profiles remotely
USMT customization
Free

Leave a Comment

Your email address will not be published. Required fields are marked *