Pumpernickel
asked on
USMT 4.0 VBScript
I'm using the "Script USMT 4.0 PC-to-PC" (http://gallery.technet.mic rosoft.com /scriptcen ter/f20a0a 75-c903-45 48-9bb4-e3 8fba0802ee ). I copied robocopy to the XP machine and I put pstools and the x86, x64 usmt from the Windows AIK in there.
After I run the VB script, it fails when it gets to the "Executing Loadstate on <new_machine> ...... Failure(27)"
The only thing in the log files are:
2012-04-23 09:59:15, Info [0x000000] USMT Started at 2012/04/23:09:59:15.655
2012-04-23 09:59:15, Info [0x000000] Command line: \\USMT_DESKTOP\usmt$\x64\l oadstate.e xe c:\Temp\MigData\USERNAME\O LD_MACHINE /v:13 /i:\\USMT_DESKTOP\usmt$\x6 4\Migapp.x ml /i:\\USMT_DESKTOP\usmt$\x6 4\MigDocs. xml /i:\\USMT_DESKTOP\usmt$\x6 4\miguser. xml /progress:c:\Temp\MigData\ USERNAME\L oadStatePr og.log /l:c:\Temp\MigData\USERNAM E\LoadStat e.log /ui:Nash\USERNAME /c
¿2012-04-23 09:59:15, Status [0x000000] Activity: 'MIGACTIVITY_COMMAND_LINE_ PROCESSING '
2012-04-23 09:59:15, Info [0x000000] Failed.[gle=0x00000006]
2012-04-23 09:59:15, Info [0x000000] USMT Status 1059 (INVALID_STORE_PATH): An error occurred processing the command line.
Invalid store path; check the store parameter and/or file system permissions[gle=0x00000006 ]
2012-04-23 09:59:15, Info [0x000000] USMT Completed at 2012/04/23:09:59:15.702[gl e=0x000000 06]
¿2012-04-23 09:59:15, Info [0x000000] Entering MigShutdown method
2012-04-23 09:59:15, Info [0x000000] Leaving MigShutdown method
Any ideas?
After I run the VB script, it fails when it gets to the "Executing Loadstate on <new_machine> ...... Failure(27)"
The only thing in the log files are:
2012-04-23 09:59:15, Info [0x000000] USMT Started at 2012/04/23:09:59:15.655
2012-04-23 09:59:15, Info [0x000000] Command line: \\USMT_DESKTOP\usmt$\x64\l
¿2012-04-23 09:59:15, Status [0x000000] Activity: 'MIGACTIVITY_COMMAND_LINE_
2012-04-23 09:59:15, Info [0x000000] Failed.[gle=0x00000006]
2012-04-23 09:59:15, Info [0x000000] USMT Status 1059 (INVALID_STORE_PATH): An error occurred processing the command line.
Invalid store path; check the store parameter and/or file system permissions[gle=0x00000006
2012-04-23 09:59:15, Info [0x000000] USMT Completed at 2012/04/23:09:59:15.702[gl
¿2012-04-23 09:59:15, Info [0x000000] Entering MigShutdown method
2012-04-23 09:59:15, Info [0x000000] Leaving MigShutdown method
Any ideas?
ASKER
I was looking at that actaully a few min ago, and it looks like Robocopy isn't even copying the .mig file to the new machine... I think the problem is with robocopy... I just have to lookup the switch for logging on robocopy so I can see what the error is
ASKER
Yup, robocopy isn't copying the data.
2012/04/23 11:27:40 ERROR 5 (0x00000005) Creating Destination Directory \\NEW_COMPUTER\c$\Temp\Mig Data\
Access is denied.
2012/04/23 11:27:40 ERROR 5 (0x00000005) Creating Destination Directory \\NEW_COMPUTER\c$\Temp\Mig
Access is denied.
You'll need to ensure that robocopy has permission to write to that directory on the new machine. Is there a common account for both machines?
ASKER
Hmm It can't even read whats in the new machines files...
2012/04/23 11:36:13 ERROR 5 (0x00000005) Getting File System Type of Destination \\NEW_COMPUTER\c$\Temp\Mig Data\
Access is denied.
The script never prompts for a username and password... I figured psexec was using my user account to execute the commands
2012/04/23 11:36:13 ERROR 5 (0x00000005) Getting File System Type of Destination \\NEW_COMPUTER\c$\Temp\Mig
Access is denied.
The script never prompts for a username and password... I figured psexec was using my user account to execute the commands
ASKER
Heres the robocopy command in the script
Sub CopyUSMTData()
REM Define Local Objects
DIM FSO : SET FSO = CreateObject("Scripting.Fi leSystemOb ject")
DIM oShell : SET oShell = CreateObject("Wscript.Shel l")
REM Define Local Variables
DIM SourceUSMTPath : SourceUSMTPath = "\\" & OldComputer & "\c$\Temp\MigData"
DIM DestUSMTPath : DestUSMTPath = "\\" & NewComputer & "\c$\Temp\MigData"
DIM Parameters : Parameters = "/e /eta /mir /log:log.txt"
DIM RemoteExec : RemoteExec = USMTLocation & "PSTools\PsExec.exe \\" & OldComputer &_
Chr(32) & "-s" & Chr(32)
DIM RoboCopyCMD : RoboCopyCMD = RemoteExec & "RoboCopy.exe" & Chr(32) & SourceUSMTPath & Chr(32) & DestUSMTPath &_
Chr(32) & Parameters
objIE.Document.WriteLn "Copying USMT folder from " & OldComputer & " to " & NewComputer & "....."
oShell.Run RoboCopyCMD, 7, True
If FSO.FolderExists(DestUSMTP ath) then
objIE.Document.WriteLn "Success" & "<BR><BR>"
else
objIE.Document.WriteLn "Failure" & "<BR><BR>"
End If
REM Cleanup Variables
Set FSO = Nothing
Set oShell = Nothing
SET SourceUSMTPath = Nothing
SET DestUSMTPath = Nothing
Set Parameters = Nothing
Set RemoteExec = Nothing
Set RoboCopyCMD = Nothing
End Sub
Sub CopyUSMTData()
REM Define Local Objects
DIM FSO : SET FSO = CreateObject("Scripting.Fi
DIM oShell : SET oShell = CreateObject("Wscript.Shel
REM Define Local Variables
DIM SourceUSMTPath : SourceUSMTPath = "\\" & OldComputer & "\c$\Temp\MigData"
DIM DestUSMTPath : DestUSMTPath = "\\" & NewComputer & "\c$\Temp\MigData"
DIM Parameters : Parameters = "/e /eta /mir /log:log.txt"
DIM RemoteExec : RemoteExec = USMTLocation & "PSTools\PsExec.exe \\" & OldComputer &_
Chr(32) & "-s" & Chr(32)
DIM RoboCopyCMD : RoboCopyCMD = RemoteExec & "RoboCopy.exe" & Chr(32) & SourceUSMTPath & Chr(32) & DestUSMTPath &_
Chr(32) & Parameters
objIE.Document.WriteLn "Copying USMT folder from " & OldComputer & " to " & NewComputer & "....."
oShell.Run RoboCopyCMD, 7, True
If FSO.FolderExists(DestUSMTP
objIE.Document.WriteLn "Success" & "<BR><BR>"
else
objIE.Document.WriteLn "Failure" & "<BR><BR>"
End If
REM Cleanup Variables
Set FSO = Nothing
Set oShell = Nothing
SET SourceUSMTPath = Nothing
SET DestUSMTPath = Nothing
Set Parameters = Nothing
Set RemoteExec = Nothing
Set RoboCopyCMD = Nothing
End Sub
Is this something you're working on to migrate a bunch of accounts, or just this one time?
I can see 2 ways through this easily,
1. Create an account on the target machine with read/write access to c:\temp\migdata, or
2. Change permissions on "C:\temp\migdata" folder to allow everyone to read/write
If this is a one time deal, I'd say give read/write access to the folder to everyone so it can be done quickly, just make sure to delete the data from that folder once you are sure the transfer is done, so no-one can access it without authorization.
If this is a setup that will be used multiple times on multiple machines, I'd recommend sorting out an account that can have read/write access on all the machines, and run the scripts all under that account.
:o)
Bartender_1
I can see 2 ways through this easily,
1. Create an account on the target machine with read/write access to c:\temp\migdata, or
2. Change permissions on "C:\temp\migdata" folder to allow everyone to read/write
If this is a one time deal, I'd say give read/write access to the folder to everyone so it can be done quickly, just make sure to delete the data from that folder once you are sure the transfer is done, so no-one can access it without authorization.
If this is a setup that will be used multiple times on multiple machines, I'd recommend sorting out an account that can have read/write access on all the machines, and run the scripts all under that account.
:o)
Bartender_1
ASKER
Even if an account was created... Where would this account be put... The script doesn't call for one, so I'm guessing it would have to be put in psexec.exe -u username -p password ?
Are these computers a part of a domain? If so, run the scripts with an Admin account, if they are not part of a domain, then I would create a duplicate account on the target machine, with the same username/password as the source machine.
ASKER
Does it matter if this script is ran from a remote machine or should it be ran on the machine you are transferring the settings from?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I was running it from a remote machine. I will try them both now. Should I be logged in as the user whos profile needs to be transfer or should it be another account?
It should work when logged in as the user whose profile is being transferred.
ASKER
Still the same error on either machine with robocopy:
-------------------------- ---------- ---------- ---------- ---------- ---------- ---
ROBOCOPY :: Robust File Copy for Windows :: Version XP010
-------------------------- ---------- ---------- ---------- ---------- ---------- ---
Started : Mon Apr 23 14:08:20 2012
2012/04/23 14:08:21 ERROR 5 (0x00000005) Getting File System Type of Destination \\NEW_MACHINE\c$\Temp\MigD ata\
Access is denied.
Source : \\OLD_MACHINE\c$\Temp\MigD ata\
Dest - \\NEW_MACHINE\c$\Temp\MigD ata\
Files : *.*
Options : *.* /S /E /COPY:DAT /PURGE /MIR /ETA /R:1000000 /W:30
-------------------------- ---------- ---------- ---------- ---------- ---------- --
2012/04/23 14:08:21 ERROR 5 (0x00000005) Creating Destination Directory \\NEW_MACHINE\c$\Temp\MigD ata\
Access is denied.
--------------------------
ROBOCOPY :: Robust File Copy for Windows :: Version XP010
--------------------------
Started : Mon Apr 23 14:08:20 2012
2012/04/23 14:08:21 ERROR 5 (0x00000005) Getting File System Type of Destination \\NEW_MACHINE\c$\Temp\MigD
Access is denied.
Source : \\OLD_MACHINE\c$\Temp\MigD
Dest - \\NEW_MACHINE\c$\Temp\MigD
Files : *.*
Options : *.* /S /E /COPY:DAT /PURGE /MIR /ETA /R:1000000 /W:30
--------------------------
2012/04/23 14:08:21 ERROR 5 (0x00000005) Creating Destination Directory \\NEW_MACHINE\c$\Temp\MigD
Access is denied.
It's odd that the system is having issues creating the directory.
Can you try changing the target destination directory, try something like:
\\new_machine\c$\migdata
Can you try changing the target destination directory, try something like:
\\new_machine\c$\migdata
ASKER
I got it to finally work, I removed the -s from the command so its uses the currently logged in account. So as long as that person is an admin on the machines, it will work.
DIM RemoteExec : RemoteExec = USMTLocation & "PSTools\PsExec.exe \\" & OldComputer &_
Chr(32) & "-s" & Chr(32)
So it should be:
DIM RemoteExec : RemoteExec = USMTLocation & "PSTools\PsExec.exe \\" & OldComputer &_
Chr(32) & "" & Chr(32)
DIM RemoteExec : RemoteExec = USMTLocation & "PSTools\PsExec.exe \\" & OldComputer &_
Chr(32) & "-s" & Chr(32)
So it should be:
DIM RemoteExec : RemoteExec = USMTLocation & "PSTools\PsExec.exe \\" & OldComputer &_
Chr(32) & "" & Chr(32)
I keep getting the below error:
2013-08-28 13:24:48, Info [0x000000] USMT Started at 2013/08/28:13:24:48.962
2013-08-28 13:24:48, Info [0x000000] Command line: \\MININT-1ABF79\Datastore\ USMTLocati on\x86\loa dstate.exe c:\Temp\MigData\daveni\A11 001C234E35 89 /v:13 /i:\\MININT-1ABF79\Datasto re\USMTLoc ation\x86\ Migapp.xml /i:\\MININT-1ABF79\Datasto re\USMTLoc ation\x86\ MigDocs.xm l /i:\\MININT-1ABF79\Datasto re\USMTLoc ation\x86\ miguser.xm l /progress:c:\Temp\MigData\ daveni\Loa dStateProg .log /l:c:\Temp\MigData\daveni\ LoadState. log /ui:office\daveni /c
¿2013-08-28 13:24:48, Status [0x000000] Activity: 'MIGACTIVITY_COMMAND_LINE_ PROCESSING '
2013-08-28 13:24:48, Info [0x000000] Failed.[gle=0x00000003]
2013-08-28 13:24:48, Info [0x000000] An error occurred processing the command line.
Invalid store path; check the store parameter and/or file system permissions[gle=0x00000003 ]
2013-08-28 13:24:48, Info [0x000000] USMT Completed at 2013/08/28:13:24:48.962[gl e=0x000000 03]
¿2013-08-28 13:24:48, Info [0x000000] Entering MigShutdown method
2013-08-28 13:24:48, Info [0x000000] Leaving MigShutdown method
2013-08-28 13:24:48, Info [0x000000] USMT Started at 2013/08/28:13:24:48.962
2013-08-28 13:24:48, Info [0x000000] Command line: \\MININT-1ABF79\Datastore\
¿2013-08-28 13:24:48, Status [0x000000] Activity: 'MIGACTIVITY_COMMAND_LINE_
2013-08-28 13:24:48, Info [0x000000] Failed.[gle=0x00000003]
2013-08-28 13:24:48, Info [0x000000] An error occurred processing the command line.
Invalid store path; check the store parameter and/or file system permissions[gle=0x00000003
2013-08-28 13:24:48, Info [0x000000] USMT Completed at 2013/08/28:13:24:48.962[gl
¿2013-08-28 13:24:48, Info [0x000000] Entering MigShutdown method
2013-08-28 13:24:48, Info [0x000000] Leaving MigShutdown method
Don't mean to highjack this thread but does anyone know where to get the script mentioned above? When I select the link provided I get a message saying that the resource hasn't been published yet.
Thanks
Thanks
It looks as if a copy of the script has been loaded here: http://mickitblog.blogspot.ca/2012/04/usmt-40-pc-to-pc.html
As with any script from the internet, please take all necessary precautions to protect your data before using. (Better safe than sorry!)
Bartender_1
As with any script from the internet, please take all necessary precautions to protect your data before using. (Better safe than sorry!)
Bartender_1
The above states that there are a few things that could be causing this error 27, the most common is the store is not accessible or does not have proper permissions (for the target machine)
Could you check to ensure the path is correct, and that the permissions are correct?
One other thing stated is that there might be an existing store already present, so you should use the /o switch to overwrite.
Hope this helps!
:o)
Bartender_1