Martin Zugec Posted July 21, 2005 Posted July 21, 2005 Maybe you should think about using Profile Maker (www.autoprof.com), it is one of my favourites tools for managing desktops
fly Posted July 21, 2005 Author Posted July 21, 2005 Maybe you should think about using Profile Maker (www.autoprof.com), it is one of my favourites tools for managing desktops<{POST_SNAPBACK}>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...
fly Posted July 21, 2005 Author Posted July 21, 2005 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.<{POST_SNAPBACK}>I just tried that. Didnt work for me.
Martin Zugec Posted July 22, 2005 Posted July 22, 2005 It is worth the money - not just outlook configuration, it is awesome replacement of logon script... About USMT:Save-Auto.batrem @echo offclsSetLocal EnableDelayedExpansionSet strLaunchDirectory=%~dp0Set strIni2Include=usmtSet strServerIniPath=\\domain.cz\Netlogon\ServersIniFor /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 instalacieIf exist %strLogStore%\%ComputerName% rmdir /s /q %strLogStore%\%ComputerName%If exist %strDateStore%\%ComputerName% rmdir /s /q %strDateStore%\%ComputerName%rem Konverzia + ulozenie datumufor /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:PrevedDatumset /a strDnesnyDatum=strUniversalDaterem Nacitanie suborovFor /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:Savemkdir %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.logEcho %date:~3,10%,%ComputerName%,%strBeginTime%,%time:~0,5% >> %strLogStore%\Summary.logGoto :EOF:PrevedDatumSet /a strDay=100%strDay%%%100,strMonth=100%strMonth%%%100Set /a z=14-strMonth,z/=12,strYear=strYear+4800-z,strMonth=strMonth+12*z-3,strUniversalDate=153*strMonth+2set /a strUniversalDate=strUniversalDate/5+strDay+strYear*365+strYear/4-strYear/100+strYear/400-2432046goto:eof:Kodset /a strRozdielDatumov=strDnesnyDatum-strFileDateIf %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% dnamigoto:eofLoad-Auto.bat@echo off Set strLaunchDirectory=%~dp0Set strIni2Include=usmtSet strServerIniPath=\\domain.cz\Netlogon\ServersIniFor /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.logUsmt.inistrDataStore=\\server2\datastore\usmtstrLogStore=\\server1\logs\migration\usmtstrBinStore=\\server1\instal\scripty\UsmtIt is code using my dynamic variables way - have a look at my blog
fly Posted July 22, 2005 Author Posted July 22, 2005 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.
Martin Zugec Posted July 22, 2005 Posted July 22, 2005 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 profilesstrLogStore = where to store logsstrBinStore = where USMT directory is stored with scripts etc...
fly Posted July 22, 2005 Author Posted July 22, 2005 Where does it add the users that you found to the scanstate command line tho?
fly Posted August 2, 2005 Author Posted August 2, 2005 (edited) It is worth the money - not just outlook configuration, it is awesome replacement of logon script... About USMT:Save-Auto.batrem @echo offclsSetLocal EnableDelayedExpansionSet strLaunchDirectory=%~dp0Set strIni2Include=usmtSet strServerIniPath=\\domain.cz\Netlogon\ServersIniFor /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 instalacieIf exist %strLogStore%\%ComputerName% rmdir /s /q %strLogStore%\%ComputerName%If exist %strDateStore%\%ComputerName% rmdir /s /q %strDateStore%\%ComputerName%rem Konverzia + ulozenie datumufor /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:PrevedDatumset /a strDnesnyDatum=strUniversalDaterem Nacitanie suborovFor /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:Savemkdir %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.logEcho %date:~3,10%,%ComputerName%,%strBeginTime%,%time:~0,5% >> %strLogStore%\Summary.logGoto :EOF:PrevedDatumSet /a strDay=100%strDay%%%100,strMonth=100%strMonth%%%100Set /a z=14-strMonth,z/=12,strYear=strYear+4800-z,strMonth=strMonth+12*z-3,strUniversalDate=153*strMonth+2set /a strUniversalDate=strUniversalDate/5+strDay+strYear*365+strYear/4-strYear/100+strYear/400-2432046goto:eof:Kodset /a strRozdielDatumov=strDnesnyDatum-strFileDateIf %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% dnamigoto:eofLoad-Auto.bat@echo off Set strLaunchDirectory=%~dp0Set strIni2Include=usmtSet strServerIniPath=\\domain.cz\Netlogon\ServersIniFor /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.logUsmt.inistrDataStore=\\server2\datastore\usmtstrLogStore=\\server1\logs\migration\usmtstrBinStore=\\server1\instal\scripty\UsmtIt is code using my dynamic variables way - have a look at my blog<{POST_SNAPBACK}>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! Edited August 2, 2005 by fly
Martin Zugec Posted August 3, 2005 Posted August 3, 2005 rem Nacitanie suborovFor /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\%%nI am sorry, but I probably wont be able to describe the script today... Remind me tomorrow please
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now