Jump to content

Problem with user profile migration


Recommended Posts

Hi! I am planning to include USMT in my unattended process - everything looks fine. I am able to save user profile, also I am able to redeploy it.

As I said it is unattended process :) So my user migration is working automatically - technician send package to computer (Unicenter Software Delivery 4.0), this package will automatically save the profile to network, PC will be reinstalled with applications etc. and after this process profile will be loaded.

My problem is with automatization - loading works great, but I have few problems with saving - after I tried to save profile, I always get message Error 5: Failed to inicialize infrastructure. I included my script for saving profiles, do you have any ideas?

@echo off
cls
set UsmtPath=\\server\usmt

Title Deleting logs
If exist %UsmtPath%\logs\%ComputerName% rmdir /s /q %UsmtPath%\logs\%ComputerName%
If exist %UsmtPath%\Profiles\%ComputerName% rmdir /s /q %UsmtPath%\Profiles\%ComputerName%

rem Reading date format
for /f "skip=1 tokens=2-4 delims=(-)" %%a in ('echo.^|date') do (
 set A=%%a&set B=%%b&set C=%%c)
 
rem Converting + saving date
set t=2&if "%date%z" LSS "A" set t=1
for /f "skip=1 tokens=2-4 delims=(-)" %%a in ('echo.^|date') do (
 for /f "tokens=%t%-4 delims=.-/ " %%d in ('date/t') do (
   set dd=%%d&set mm=%%e&set rr=%%f))
call:PrevedDatum
set /a strDnesnyDatum=strUniversalDate

rem Loading files
for /f "tokens=1-7 delims=:.-/ " %%a in (
 'dir "C:\Documents and Settings" 2^>nul^|findstr /v /b /c:" "'
) do (
 If "%%g" NEQ "" (
     set %A%=%%a&set %B%=%%b&set %C%=%%c&set strProfile=%%g
     call:PrevedDatum
     call:Kod
     )
)


Title Creating user profile
:Save
mkdir %UsmtPath%\logs\%ComputerName%

Title Saving user profile
%UsmtPath%\bin\scanstate.exe %UsmtPath%\profiles\%ComputerName% /i:%UsmtPath%\Bin\MigSys.inf /i:%UsmtPath%\Bin\MigUser.inf /i:%UsmtPath%\Bin\MigIsm.inf /i:%UsmtPath%\Bin\ExcludeDir.inf /i:%UsmtPath%\Bin\IncludeFiles.inf /i:%UsmtPath%\Bin\sysfiles.inf /compress+ /l:%UsmtPath%\logs\%ComputerName%\SaveDetails.log /progress:%UsmtPath%\logs\%ComputerName%\SaveSummary.log  /o /v:1 /c /localonly %UsmtProfile%
pause
Goto :EOF

:PrevedDatum
rem Converting to Julian calendar
set /a dd=100%dd%%%100,mm=100%mm%%%100
set /a z=14-mm,z/=12,r=rr+4800-z,m=mm+12*z-3,strUniversalDate=153*m+2
set /a strUniversalDate=strUniversalDate/5+dd+r*365+r/4-r/100+r/400-2432046
goto:eof

:Kod
set /a strRozdielDatumov=strDnesnyDatum-strUniversalDate
If %strRozdielDatumov% LSS 30 set UsmtProfile=%UsmtProfile% /user:PRE\%strProfile%
goto:eof

Link to comment
Share on other sites


I've never seen that error - I dont use USMT very often.

Are your users members of a domain? USMT may not work with Workgroup users.

I use the following command line options

%USMTCMD%\scanstate.exe "%USMTPATH%" /i "%CFGPATH%\sysfiles.inf" /i "%CFGPATH%\Migapp.inf" /i "%CFGPATH%\Migsys.inf" /i "%CFGPATH%\miguser.inf" /i "%CFGPATH%\UserData.inf" /l "%USMTPATH%\scanlog.txt" /v 7 /x /s /f /o /q

Link to comment
Share on other sites

Yep, my users are domain users of course. Could you please try to run your scanstate under diffeerent user profile, that dont have profile in that computer (using RunAs)? It could really help me to know if it is fault in my code, or in USMT

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...