[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/se3-domain/home/netlogon/domscripts/ -> Etapefinale.cmd (source)

   1  :: script lance en adminse3
   2  :: il permet d'activer le compte adminse3 et de creer son profil, car sinon on a des surprises ensuite....
   3  @echo off
   4  pushd %SystemDrive%\netinst
   5  time /T >> logs\domscripts.txt
   6  echo etapefinale : finition de l'installation >> logs\domscripts.txt
   7  call %systemdrive%\netinst\se3ip.bat
   8  netsh firewall set portopening protocol=UDP port=137 name=se3_137 mode=ENABLE scope=CUSTOM addresses=%se3ip%/255.255.255.255
   9  netsh firewall set portopening protocol=TCP port=139 name=se3_139 mode=ENABLE scope=CUSTOM addresses=%se3ip%/255.255.255.255
  10  netsh firewall set portopening protocol=UDP port=138 name=se3_138 mode=ENABLE scope=CUSTOM addresses=%se3ip%/255.255.255.255
  11  netsh firewall set portopening protocol=TCP port=445 name=se3_445 mode=ENABLE scope=CUSTOM addresses=%se3ip%/255.255.255.255
  12  reg delete "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters" /v "AutoShareWks" /f 2>NUL
  13  reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa" /v "ForceGuest" /t "REG_DWORD" /d "0" /f 2>NUL 
  14  reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\NetCache" /v "Formatdatabase" /t "REG_DWORD" /d "1" /F 2>NUL
  15  reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\NetCache" /v "Enabled" /t "REG_DWORD" /d "0" /F 2>NUL
  16  
  17  echo preparation des GPO
  18  
  19  :: recherche du numero de version gpo et on l'incremente si il existe.
  20  for /f "tokens=3 delims= " %%a in ('reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\State\Machine\GPO-List\0" /v Version ^| findstr REG_DWORD ') do @set /a VERSION=~%%c+65537
  21  if "%VERSION%" == "" set VERSION=65537
  22  :: creation des GPO minimales
  23  mkdir %SYSTEMROOT%\System32\GroupPolicy
  24  mkdir %SYSTEMROOT%\System32\GroupPolicy\Machine
  25  mkdir %SYSTEMROOT%\System32\GroupPolicy\Machine\Scripts
  26  mkdir %SYSTEMROOT%\System32\GroupPolicy\Machine\Scripts\Startup
  27  mkdir %SYSTEMROOT%\System32\GroupPolicy\Machine\Scripts\Shutdown
  28  
  29  echo [general]>%SYSTEMROOT%\System32\GroupPolicy\gpt.ini
  30  echo Version=%VERSION%>>%SYSTEMROOT%\System32\GroupPolicy\gpt.ini
  31  echo gPCUserExtensionNames=[{35378EAC-683F-11D2-A89A-00C04FBBCFA2}{0F6B957E-509E-11D1-A7CC-0000F87571E3}][{42B5FAAE-6536-11D2-AE5A-0000F87571E3}{40B66650-4972-11D1-A7CA-0000F87571E3}]>>%SYSTEMROOT%\System32\GroupPolicy\gpt.ini
  32  echo gPCMachineExtensionNames=[{35378EAC-683F-11D2-A89A-00C04FBBCFA2}{0F6B957D-509E-11D1-A7CC-0000F87571E3}][{42B5FAAE-6536-11D2-AE5A-0000F87571E3}{40B6664F-4972-11D1-A7CA-0000F87571E3}]>>%SYSTEMROOT%\System32\GroupPolicy\gpt.ini
  33  
  34  copy %SYSTEMDRIVE%\netinst\scriptsC.ini %SYSTEMROOT%\System32\GroupPolicy\Machine\Scripts\scripts.ini
  35  
  36  echo rem script de demarrage se3>%SYSTEMROOT%\System32\GroupPolicy\Machine\Scripts\Startup\Startup.cmd
  37  echo echo ok^>^>%SystemDrive%\netinst\logs\GPO.txt>%SYSTEMROOT%\System32\GroupPolicy\Machine\Scripts\Startup\Startup.cmd
  38  echo rem script de demarrage se3>%SYSTEMROOT%\System32\GroupPolicy\Machine\Scripts\Shutdown\Shutdown.cmd
  39  echo del /F /Q %SystemDrive%\netinst\*>>%SYSTEMROOT%\System32\GroupPolicy\Machine\Scripts\Shutdown\Shutdown.cmd
  40  gpupdate /force
  41  
  42  echo lancement du job se3 en adminse3
  43  start /wait %systemdrive%\netinst\CPAU.exe -wait -dec -lwp -cwd %systemdrive%\netinst -file %SystemDrive%\netinst\se3.job
  44  echo nettoyage du script se3.cmd
  45  del /F /Q %SystemDrive%\netinst\se3.cmd
  46  if exist "%systemDrive%\Documents and settings\administrateur_savse3" rd /S /Q "%systemDrive%\Documents and settings\administrateur_savse3"
  47  if exist "%systemDrive%\Documents and settings\administrateur" move "%systemDrive%\Documents and settings\administrateur" "%systemDrive%\Documents and settings\administrateur_savse3" && echo profil administrateur renomme
  48  
  49  echo le poste est pret : fin de la mise au domaine>> logs\domscripts.txt
  50  %SystemRoot%\system32\shutdown.exe -r -t 5 -c "Windows est pret pour se3 : les programmes vont s'installer au prochain reboot"
  51  


Generated: Tue Mar 17 22:47:18 2015 Cross-referenced by PHPXref 0.7.1