Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
— | anwenderwiki:windowsclient:struktur_login_scripte [2015/02/27 21:32] (aktuell) – angelegt - Externe Bearbeitung 127.0.0.1 | ||
---|---|---|---|
Zeile 1: | Zeile 1: | ||
+ | {{tag> windows scripte}} | ||
+ | |||
+ | ====== Struktur der Loginscripte für Windows Clients ====== | ||
+ | |||
+ | |||
+ | Diese Scripte liegen am linuxmuster.net-Server unter **''/ | ||
+ | // | ||
+ | und bestehen standardmäßig aus folgenden Dateien. Diese Scripte sind für den pgmadmin schreibbar. | ||
+ | login.bat | ||
+ | logon.bat | ||
+ | common.bat | ||
+ | teachers.bat | ||
+ | Diese Sripte werden der Reihe nach durch einen " | ||
+ | login.bat -> logon.bat -> common.bat | ||
+ | login.bat -> teachers.bat | ||
+ | |||
+ | ===== Standard: Inhalt der Scripte (Stand Feb. 2015)===== | ||
+ | |||
+ | <code text login.bat> | ||
+ | REM **************************** | ||
+ | REM * tschmitt@linuxmuster.net * | ||
+ | REM * 18.12.2014 | ||
+ | REM **************************** | ||
+ | |||
+ | @echo off | ||
+ | |||
+ | if NOT " | ||
+ | |||
+ | :winnt | ||
+ | call \\server\netlogon\logon.bat H: %USERNAME% K: pgm R: cdrom T: shares V: tasks | ||
+ | goto ende | ||
+ | |||
+ | :win9x | ||
+ | call \\server\netlogon\logon.bat H: homes K: pgm R: cdrom T: shares V: tasks | ||
+ | |||
+ | :ende | ||
+ | REM ******************************************************* | ||
+ | REM * | ||
+ | REM ******************************************************* | ||
+ | if exist \\server\students call \\server\netlogon\teachers.bat | ||
+ | rem pause | ||
+ | </ | ||
+ | |||
+ | |||
+ | <code text logon.bat> | ||
+ | @echo off | ||
+ | set SERVER=server | ||
+ | C: | ||
+ | if " | ||
+ | |||
+ | REM ******************************************************* | ||
+ | REM * | ||
+ | REM ******************************************************* | ||
+ | goto mapping | ||
+ | |||
+ | :winnt | ||
+ | REM ******************************************************* | ||
+ | REM * Windows NT/ | ||
+ | REM ******************************************************* | ||
+ | set NUOPT=/ | ||
+ | echo Trenne alle Netzwerkfreigaben | ||
+ | net use * /DELETE /YES | ||
+ | \\%SERVER%\netlogon\sleep 1000 | ||
+ | |||
+ | :mapping | ||
+ | REM ******************************************************* | ||
+ | REM * | ||
+ | REM ******************************************************* | ||
+ | if " | ||
+ | |||
+ | for %%i in (%1) do set DRIVE=%%i | ||
+ | shift | ||
+ | for %%i in (%1) do set SHARE=%%i | ||
+ | |||
+ | if not exist %DRIVE% goto connect | ||
+ | echo Trenne Laufwerk %DRIVE% | ||
+ | net use %DRIVE% /DELETE /YES > NUL | ||
+ | |||
+ | :connect | ||
+ | echo Verbinde %DRIVE% mit \\%SERVER%\%SHARE% | ||
+ | net use %DRIVE% \\%SERVER%\%SHARE% /YES %NUOPT% > NUL | ||
+ | |||
+ | shift | ||
+ | goto mapping | ||
+ | |||
+ | :time | ||
+ | REM ******************************************************* | ||
+ | REM * | ||
+ | REM ******************************************************* | ||
+ | echo Synchronisiere Uhrzeit mit Server | ||
+ | net time \\%SERVER% /SET /YES > NUL | ||
+ | |||
+ | REM ******************************************************* | ||
+ | REM * | ||
+ | REM ******************************************************* | ||
+ | if exist \\%SERVER%\netlogon\common.bat call \\%SERVER%\netlogon\common.bat | ||
+ | rem pause | ||
+ | </ | ||
+ | |||
+ | |||
+ | <code text common.bat> | ||
+ | REM Windows logon script common stuff, called by logon.bat | ||
+ | REM thomas@linuxmuster.net | ||
+ | REM 30.10.2014 | ||
+ | |||
+ | @echo off | ||
+ | |||
+ | REM Do not for Windows version prior to Win2K. | ||
+ | if NOT " | ||
+ | |||
+ | REM Extract servername from unc path. | ||
+ | set UNC=%0% | ||
+ | for /f " | ||
+ | if " | ||
+ | |||
+ | REM Create personal folders in homedir. Comment it out if you don't want. | ||
+ | for %%i in (Bilder Einstellungen Dokumente Downloads Musik Videos) do if not exist " | ||
+ | |||
+ | |||
+ | REM ### Add your custom stuff here - begin ### | ||
+ | |||
+ | REM ### Custom stuff - end ### | ||
+ | |||
+ | |||
+ | REM ### Default user profile stuff - begin ### | ||
+ | |||
+ | REM Set name for template user. | ||
+ | set TEMPLATE=pgmadmin | ||
+ | |||
+ | REM Do not for template user. | ||
+ | if " | ||
+ | |||
+ | REM Do not if user profile does not exist. | ||
+ | if NOT exist " | ||
+ | |||
+ | REM Replace template user paths in registry. | ||
+ | cd " | ||
+ | |||
+ | reg export " | ||
+ | cscript \\%SERVER%\netlogon\replace.vbs \\" | ||
+ | reg import %USERNAME%.reg | ||
+ | |||
+ | reg export " | ||
+ | cscript \\%SERVER%\netlogon\replace.vbs \\" | ||
+ | reg import %USERNAME%.reg | ||
+ | |||
+ | reg export " | ||
+ | cscript \\%SERVER%\netlogon\replace.vbs \\" | ||
+ | reg import %USERNAME%.reg | ||
+ | |||
+ | reg export " | ||
+ | cscript \\%SERVER%\netlogon\replace.vbs \\" | ||
+ | reg import %USERNAME%.reg | ||
+ | |||
+ | reg export " | ||
+ | cscript \\%SERVER%\netlogon\replace.vbs \\" | ||
+ | reg import %USERNAME%.reg | ||
+ | |||
+ | reg export " | ||
+ | cscript \\%SERVER%\netlogon\replace.vbs \\" | ||
+ | reg import %USERNAME%.reg | ||
+ | |||
+ | del %USERNAME%.reg | ||
+ | |||
+ | REM Patch drive names | ||
+ | |||
+ | REM pgm | ||
+ | reg add HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2\## | ||
+ | |||
+ | REM cdrom | ||
+ | reg add HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2\## | ||
+ | |||
+ | REM share | ||
+ | reg add HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2\## | ||
+ | |||
+ | REM tasks | ||
+ | reg add HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2\## | ||
+ | |||
+ | REM students | ||
+ | reg add HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2\## | ||
+ | |||
+ | REM home | ||
+ | reg add HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2\## | ||
+ | |||
+ | : | ||
+ | |||
+ | REM ### Default user profile stuff - end ### | ||
+ | |||
+ | |||
+ | REM End of script | ||
+ | :common_end | ||
+ | |||
+ | </ | ||
+ | |||
+ | |||
+ | <code text teachers.bat> | ||
+ | REM **************************** | ||
+ | REM * tschmitt@linuxmuster.net * | ||
+ | REM * 18.12.2014 | ||
+ | REM **************************** | ||
+ | |||
+ | @echo off | ||
+ | |||
+ | if not exist S: goto connect | ||
+ | echo Trenne Laufwerk S: | ||
+ | net use S: /DELETE /YES > NUL | ||
+ | |||
+ | :connect | ||
+ | echo Verbinde S: mit \\server\students | ||
+ | net use S: \\server\students /YES / | ||
+ | </ | ||
+ | |||
+ | |||