Skip to content
View in the app

A better way to browse. Learn more.

MSFN

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Help Automating Remote USMT

Featured Replies

Hi, if anyone can help out, it would be much appreciated. I am trying to have my script initiate either scan or loadstate on a remote machine. I think I am close now, but when I run the create method it returns the "cannot find path" error. I am not sure why this is happening. He is the script

'AutomateUSMT.vbs
'Script to automate USMT commands
'Author: Steve Stern
'Modified Last: Craig Smith
'Updated: 3-07-2008
'
'ToDo
'Change the UI
'Validate User profile exists
'Validate USMT is there (maybe automatically move the needed files there)
'Verify PC is Turned on and able to be reached (Ping?)
'Let Admin know when process finishes
'Auto start loadstate on new machine when scanstate finishes
'
'---------------------------------------------

Option Explicit
Dim objWMIService, objProcess, strUE, strTags, strSTag
Dim strShell, objProgram, strComputer, strScanState, strLoadState
Dim strUser, strServer, strInput, strUSMT, strUI, strExe
Dim objStartup, intProcessID, objConfig, intReturn

'strServer = " \\FQDN\tempxfer$\" 'Keep the space in front
strServer = " c:\USMT" 'Delete this line when not testing locally
strScanState = Chr(34) & "c:\program files\USMT301\ScanState.exe" & Chr(34)
strLoadState = Chr(34) & "%programfiles%\USMT301\LoadState.exe" & Chr(34)
strTags = " /i:migapp.xml /i:migsys.xml /i:miguser.xml /c" 'Keep the Space in the front
strSTag = " /targetxp" 'Keep the space in the front
strUE = " /ue:*\*" 'Keep the space in the front

Do
strUser = (InputBox("Input the AD name of the User to migrate","User Name"))
If strUser <> "" Then
strInput = True
End If
Loop until strInput = True
'strUI = " /ui:" & chr(34) & "faa\" & strUser & chr(34)
strUI = " /ui:" & strUser 'Delete This Line when not using with local accounts
strInput = ""

Do
strComputer = (InputBox("Input the Computer DNS Name","Computer Name"))
If strComputer <> "" Then
strInput = True
End If
Loop until strInput = True
strInput = ""
Do
strUSMT = (InputBox("Type ""Scan"" for ScanState and ""load"" for LoadState","USMT"))
If strUSMT <> "" Then
strInput = True
End If
Loop until strInput = True

Select Case strUSMT
Case "scan"
'Build the command
strExe = Chr(34) & strScanState & chr(34) & strServer & strUser & chr(34) & strSTag & strTags & Chr(34)
runUSMT
Case "load"
'Build the command
strExe = strLoadState & chr(34) & strServer & strUser & chr(34) & strTags & _
strUE & strUI
runUSMT
Case Else
MsgBox = ("You did not enter a correct option")
WScript.Quit
End Select



Sub runUSMT
set objWMIService = getobject("winmgmts://"& strComputer & "/root/cimv2")
set objStartup = objWMIService.Get("Win32_ProcessStartup")
Set objConfig = objStartup.SpawnInstance_
objConfig.ShowWindow = 0
objConfig.PriorityClass = 32
set objProcess = objWMIService.Get("Win32_Process")
intReturn = objProcess.Create(strExe, Null, objConfig, intProcessID)
'Error Checking
Select Case intReturn
Case 0
WScript.echo "Process Started Successfully. Process ID: " _
& intProcessID
Case 2
WScript.echo "Access is Denied"
Case 3
WScript.echo "Insufficient Privilege"
Case 8
WScript.echo "Unknown Failure"
Case 9
WScript.echo "Path Not Found"
Case 21
WScript.echo "Invalid Parameter"
Case Else
Wscript.echo "Something went horribly wrong"
End Select
End Sub


Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.