result=MsgBox("Voulez-vous configurer ce poste pour une mise à jour automatique sur le serveur du rectorat ?",35, "Windows Update - Académie de Créteil") TargetGroup=InputBox("Entrez le RNE de l'établissement :","Windows Update - Académie de Créteil","") Set WshShell = WScript.CreateObject("WScript.Shell") IF result=6 THEN WshShell.RegWrite "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate\TargetGroupEnabled", "1", "REG_DWORD" WshShell.RegWrite "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate\TargetGroup", TargetGroup , "REG_SZ" WshShell.RegWrite "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate\WUServer", "http://wsus.in.ac-creteil.fr:8530", "REG_SZ" WshShell.RegWrite "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate\WUStatusServer", "http://wsus.in.ac-creteil.fr:8530", "REG_SZ" WshShell.RegWrite "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate\ElevateNonAdmins", "0", "REG_DWORD" WshShell.RegWrite "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate\AU\NoAutoUpdate", "0", "REG_DWORD" WshShell.RegWrite "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate\AU\AUOptions", "4", "REG_DWORD" WshShell.RegWrite "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate\AU\ScheduledInstallDay", "0", "REG_DWORD" WshShell.RegWrite "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate\AU\ScheduledInstallTime", "12", "REG_DWORD" WshShell.RegWrite "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate\AU\RescheduleWaitTimeEnabled", "1", "REG_DWORD" WshShell.RegWrite "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate\AU\RescheduleWaitTime", "15", "REG_DWORD" WshShell.RegWrite "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate\AU\NoAutoRebootWithLoggedOnUsers", "1", "REG_DWORD" WshShell.RegWrite "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate\AU\AutoInstallMinorUpdates", "1", "REG_DWORD" WshShell.RegWrite "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate\AU\UseWUServer", "1", "REG_DWORD" WshShell.RegWrite "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate\AU\NoAUShutdownOption", "0", "REG_DWORD" WshShell.RegWrite "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate\AU\NoAUAsDefaultShutdownOption", "0", "REG_DWORD" WshShell.RegWrite "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate\AU\RebootWarningTimeoutEnabled", "0", "REG_DWORD" WshShell.RegWrite "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate\AU\RebootRelaunchTimeoutEnabled", "0", "REG_DWORD" fin=MsgBox("Le poste est configuré pour une mise à jour automatique",64, "Windows Update - Académie de Créteil") ELSEIF result=7 THEN ON ERROR RESUME NEXT WshShell.RegDelete "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate\ElevateNonAdmins" WshShell.RegDelete "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate\AU\AUOptions" WshShell.RegDelete "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate\AU\NoAutoUpdate" WshShell.RegDelete "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate\AU\NoAUAsDefaultShutdownOption" WshShell.RegDelete "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate\AU\NoAUShutdownOption" WshShell.RegDelete "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate\AU\NoAutoRebootWithLoggedOnUsers" WshShell.RegDelete "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate\AU\NoAutoUpdate" WshShell.RegDelete "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate\AU\RebootRelaunchTimeoutEnabled" WshShell.RegDelete "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate\AU\RescheduleWaitTime" WshShell.RegDelete "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate\AU\RescheduleWaitTimeEnabled" WshShell.RegDelete "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate\AU\ScheduledInstallTime" WshShell.RegDelete "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate\AU\ScheduledInstallDay" WshShell.RegWrite "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate\AU\WaitTime", "15", "REG_DWORD" WshShell.RegWrite "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate\AU\RebootRelaunchTimeoutEnabled", "0", "REG_DWORD" fin=MsgBox("Le poste n'est plus configuré pour une mise à jour automatique",64, "Windows Update - Académie de Créteil") ELSE fin=MsgBox("Opération annulée",64, "Windows Update - Académie de Créteil") END IF