Jump to content

Recommended Posts


Posted
Maybe you should think about using Profile Maker (www.autoprof.com), it is one of my favourites tools for managing desktops

I've seen that before, but it seems like too much. All I need is to change the login name. Not sure I can justify a purchase, just to change the login name...

Posted
That is your issue right there, by default USMT only pulls the Current User's Information unless the /All Switch is used that is forcing it to check all accounts and then with /ui:90 it will weed out the accounts over 90 days old.

I just tried that. Didnt work for me. :(

Posted

It is worth the money - not just outlook configuration, it is awesome replacement of logon script... About USMT:

Save-Auto.bat

rem @echo off
cls
SetLocal EnableDelayedExpansion
Set strLaunchDirectory=%~dp0
Set strIni2Include=usmt
Set strServerIniPath=\\domain.cz\Netlogon\ServersIni
For /f "usebackq delims== tokens=1,2" %%a IN (`Type %strServerIniPath%\%strIni2Include%.ini`) DO (Set %%a=%%b)
Set strBeginTime=%time:~0,5%

Title Zmazanie logu z predchadzajucej instalacie
If exist %strLogStore%\%ComputerName% rmdir /s /q %strLogStore%\%ComputerName%
If exist %strDateStore%\%ComputerName% rmdir /s /q %strDateStore%\%ComputerName%

rem Konverzia + ulozenie datumu
for /f "usebackq tokens=1-4 delims=. " %%a in (`Echo %date:~3,10%`) do (
   set strDay=%%a&set strMonth=%%b&set strYear=%%c
   )
Echo %strDay% - %strMonth% - %strYear%
call:PrevedDatum
set /a strDnesnyDatum=strUniversalDate

rem Nacitanie suborov
For /f "usebackq tokens=1-11 delims=. " %%i IN (`dir "C:\Documents and settings"`) DO (
If %%m EQU ^<DIR^> If "%%n" NEQ "" (
 Set strDay=%%i&&Set strMonth=%%j&&Set strYear=%%k
 If "%%o" EQU "" (Set strProfile=PRE\%%n) ELSE (Set strProfile=%ComputerName%\%%n)
 call:PrevedDatum
 Set strFileDate=!struniversalDate!
 Echo !strProfile! - !strDay!:!strMonth!:!strYear! - %strDnesnyDatum% - !strFileDate!
   call:Kod
 )
)
     
   

Title Vytvorenie uzivatelskeho profilu
:Save
mkdir %strLogStore%\%ComputerName%

Title Ukladanie uzivatelskeho profilu
%strBinStore%\scanstate.exe %strDataStore%\%ComputerName% /i:%strBinStore%\MigSys.inf /i:%strBinStore%\MigUser.inf /i:%strBinStore%\MigIsm.inf /i:%strBinStore%\ExcludeDir.inf /i:%strBinStore%\IncludeFiles.inf /i:%strBinStore%\sysfiles.inf /compress+ /l:%strLogStore%\%ComputerName%\SaveDetails.log /progress:%strLogStore%\%ComputerName%\SaveSummary.log  /o /v:1 /c /localonly %UsmtProfile%
For /f "usebackq tokens=1-3 delims= " %%i IN (`type %strLogStore%\%ComputerName%\SaveDetails.log^|find /i "is included by rule"`) DO IF %%k NEQ NT Echo %%k >> %strLogStore%\%ComputerName%\IncludedUsers.log
Echo %date:~3,10%,%ComputerName%,%strBeginTime%,%time:~0,5% >> %strLogStore%\Summary.log
Goto :EOF

:PrevedDatum
Set /a strDay=100%strDay%%%100,strMonth=100%strMonth%%%100
Set /a z=14-strMonth,z/=12,strYear=strYear+4800-z,strMonth=strMonth+12*z-3,strUniversalDate=153*strMonth+2
set /a strUniversalDate=strUniversalDate/5+strDay+strYear*365+strYear/4-strYear/100+strYear/400-2432046
goto:eof

:Kod
set /a strRozdielDatumov=strDnesnyDatum-strFileDate
If %strRozdielDatumov% LSS 30 If %strProfile% NEQ %computername%\All If %strProfile% NEQ PRE\sdo_autoon If %strProfile% NEQ PRE\usdklient set UsmtProfile=%UsmtProfile% /user:%strProfile%
Echo %strProfile% - Posledna aktivacia pred %strRozdielDatumov% dnami
goto:eof

Load-Auto.bat

@echo off 
Set strLaunchDirectory=%~dp0
Set strIni2Include=usmt
Set strServerIniPath=\\domain.cz\Netlogon\ServersIni
For /f "usebackq delims== tokens=1,2" %%a IN (`Type %strServerIniPath%\%strIni2Include%.ini`) DO (Set %%a=%%b)

If not exist %strDataStore%\%ComputerName% Goto :EOF
%strBinStore%\loadstate /c /l:%strLogStore%\%ComputerName%\LoadDetails.log /v:1 /progress:%strLogStore%\%ComputerName%\LoadSummary.log %strDataStore%\%ComputerName%
rem If %errorlevel% EQU 0 rmdir /q /s %strDateStore%\%ComputerName%
if %errorlevel% NEQ 0 echo Nahranie profilu sa nepodarilo! > c:\ProfileError.log

Usmt.ini

strDataStore=\\server2\datastore\usmt
strLogStore=\\server1\logs\migration\usmt
strBinStore=\\server1\instal\scripty\Usmt

It is code using my dynamic variables way - have a look at my blog

Posted
It is worth the money - not just outlook configuration, it is awesome replacement of logon script... About USMT:

Save-Auto.bat...

Can you explain the profile scanning? I don't understand.

Posted

BTW I forget to mention, you need diruse.exe from resource kit (which is for free)

The script will scan all directories in documents and settings folder. It will find when they were last accessed, translate this value to julian calendar. Then it will translate current date to julian calendar.

It will compare this two values and if this value is lower then 30, it will include profile in migration.

The load-auto will check if migration directory for comptuter exists. If it do, it will automatically migrate profile.

In usmt.ini there are three values:

strDataStore = where to store profiles

strLogStore = where to store logs

strBinStore = where USMT directory is stored with scripts etc...

  • 2 weeks later...
Posted (edited)
It is worth the money - not just outlook configuration, it is awesome replacement of logon script... About USMT:

Save-Auto.bat

rem @echo off
cls
SetLocal EnableDelayedExpansion
Set strLaunchDirectory=%~dp0
Set strIni2Include=usmt
Set strServerIniPath=\\domain.cz\Netlogon\ServersIni
For /f "usebackq delims== tokens=1,2" %%a IN (`Type %strServerIniPath%\%strIni2Include%.ini`) DO (Set %%a=%%b)
Set strBeginTime=%time:~0,5%

Title Zmazanie logu z predchadzajucej instalacie
If exist %strLogStore%\%ComputerName% rmdir /s /q %strLogStore%\%ComputerName%
If exist %strDateStore%\%ComputerName% rmdir /s /q %strDateStore%\%ComputerName%

rem Konverzia + ulozenie datumu
for /f "usebackq tokens=1-4 delims=. " %%a in (`Echo %date:~3,10%`) do (
   set strDay=%%a&set strMonth=%%b&set strYear=%%c
   )
Echo %strDay% - %strMonth% - %strYear%
call:PrevedDatum
set /a strDnesnyDatum=strUniversalDate

rem Nacitanie suborov
For /f "usebackq tokens=1-11 delims=. " %%i IN (`dir "C:\Documents and settings"`) DO (
If %%m EQU ^<DIR^> If "%%n" NEQ "" (
 Set strDay=%%i&&Set strMonth=%%j&&Set strYear=%%k
 If "%%o" EQU "" (Set strProfile=PRE\%%n) ELSE (Set strProfile=%ComputerName%\%%n)
 call:PrevedDatum
 Set strFileDate=!struniversalDate!
 Echo !strProfile! - !strDay!:!strMonth!:!strYear! - %strDnesnyDatum% - !strFileDate!
   call:Kod
 )
)
     
   

Title Vytvorenie uzivatelskeho profilu
:Save
mkdir %strLogStore%\%ComputerName%

Title Ukladanie uzivatelskeho profilu
%strBinStore%\scanstate.exe %strDataStore%\%ComputerName% /i:%strBinStore%\MigSys.inf /i:%strBinStore%\MigUser.inf /i:%strBinStore%\MigIsm.inf /i:%strBinStore%\ExcludeDir.inf /i:%strBinStore%\IncludeFiles.inf /i:%strBinStore%\sysfiles.inf /compress+ /l:%strLogStore%\%ComputerName%\SaveDetails.log /progress:%strLogStore%\%ComputerName%\SaveSummary.log  /o /v:1 /c /localonly %UsmtProfile%
For /f "usebackq tokens=1-3 delims= " %%i IN (`type %strLogStore%\%ComputerName%\SaveDetails.log^|find /i "is included by rule"`) DO IF %%k NEQ NT Echo %%k >> %strLogStore%\%ComputerName%\IncludedUsers.log
Echo %date:~3,10%,%ComputerName%,%strBeginTime%,%time:~0,5% >> %strLogStore%\Summary.log
Goto :EOF

:PrevedDatum
Set /a strDay=100%strDay%%%100,strMonth=100%strMonth%%%100
Set /a z=14-strMonth,z/=12,strYear=strYear+4800-z,strMonth=strMonth+12*z-3,strUniversalDate=153*strMonth+2
set /a strUniversalDate=strUniversalDate/5+strDay+strYear*365+strYear/4-strYear/100+strYear/400-2432046
goto:eof

:Kod
set /a strRozdielDatumov=strDnesnyDatum-strFileDate
If %strRozdielDatumov% LSS 30 If %strProfile% NEQ %computername%\All If %strProfile% NEQ PRE\sdo_autoon If %strProfile% NEQ PRE\usdklient set UsmtProfile=%UsmtProfile% /user:%strProfile%
Echo %strProfile% - Posledna aktivacia pred %strRozdielDatumov% dnami
goto:eof

Load-Auto.bat

@echo off 
Set strLaunchDirectory=%~dp0
Set strIni2Include=usmt
Set strServerIniPath=\\domain.cz\Netlogon\ServersIni
For /f "usebackq delims== tokens=1,2" %%a IN (`Type %strServerIniPath%\%strIni2Include%.ini`) DO (Set %%a=%%b)

If not exist %strDataStore%\%ComputerName% Goto :EOF
%strBinStore%\loadstate /c /l:%strLogStore%\%ComputerName%\LoadDetails.log /v:1 /progress:%strLogStore%\%ComputerName%\LoadSummary.log %strDataStore%\%ComputerName%
rem If %errorlevel% EQU 0 rmdir /q /s %strDateStore%\%ComputerName%
if %errorlevel% NEQ 0 echo Nahranie profilu sa nepodarilo! > c:\ProfileError.log

Usmt.ini

strDataStore=\\server2\datastore\usmt
strLogStore=\\server1\logs\migration\usmt
strBinStore=\\server1\instal\scripty\Usmt

It is code using my dynamic variables way - have a look at my blog

I hate to be a total id*** here, but if you have a few minutes, would you mind translating some of the stuff in there?

That's a pretty complex batch file for an id*** like me, so any and all English helps! :P

Edited by fly
Posted

rem Nacitanie suborov
For /f "usebackq tokens=1-11 delims=. " %%i IN (`dir "C:\Documents and settings"`) DO (
If %%m EQU ^<DIR^> If "%%n" NEQ "" (
Set strDay=%%i&&Set strMonth=%%j&&Set strYear=%%k
If "%%o" EQU "" (Set strProfile=PRE\%%n) ELSE (Set strProfile=%ComputerName%\%%n)
call:PrevedDatum
Set strFileDate=!struniversalDate!
Echo !strProfile! - !strDay!:!strMonth!:!strYear! - %strDnesnyDatum% - !strFileDate!
  call:Kod
 )
)

Here is error - instead of Set strProfile=PRE\%%n there shoudl be

Set strProfile=your_domain_name\%%n

I am sorry, but I probably wont be able to describe the script today... Remind me tomorrow please :(

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Recently Browsing   0 members

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