Specify maximum wait time for Group Policy scripts
Spécifier la durée d’attente maximale pour les scripts de stratégie de groupe
Explanation
This policy setting determines how long the system waits for scripts applied by Group Policy to run.
This setting limits the total time allowed for all logon, logoff, startup, and shutdown scripts applied by Group Policy to finish running. If the scripts have not finished running when the specified time expires, the system stops script processing and records an error event.
If you enable this setting, then, in the Seconds box, you can type a number from 1 to 32,000 for the number of seconds you want the system to wait for the set of scripts to finish. To direct the system to wait until the scripts have finished, no matter how long they take, type 0.
This interval is particularly important when other system tasks must wait while the scripts complete. By default, each startup script must complete before the next one runs. Also, you can use the ""Run logon scripts synchronously"" setting to direct the system to wait for the logon scripts to complete before loading the desktop.
An excessively long interval can delay the system and inconvenience users. However, if the interval is too short, prerequisite tasks might not be done, and the system can appear to be ready prematurely.
If you disable or do not configure this setting the system lets the combined set of scripts run for up to 600 seconds (10 minutes). This is the default.
Ce paramètre de stratégie détermine la durée pendant laquelle le système attend l’exécution des scripts appliqués par la stratégie de groupe.
Ce paramètre limite la durée totale allouée à tous les scripts d’ouverture de session, de fermeture de session, de démarrage et d’arrêt appliqués par la stratégie de groupe pour terminer leur exécution. Si les scripts n’ont pas fini de s’exécuter à la fin de la durée spécifiée, le système arrête le traitement du script et enregistre un événement d’erreur.
Si vous activez ce paramètre, entrez dans la zone Secondes un nombre compris entre 1 et 32 000 correspondant au délai en secondes pendant lequel vous voulez que le système attende la fin de l’exécution du jeu de scripts. Pour que le système attende la fin de l’exécution des scripts, quelle que soit la durée nécessaire, tapez 0.
Cet intervalle est particulièrement important quand d’autres tâches système doivent attendre la fin de l’exécution des scripts. Par défaut, chaque script de démarrage doit se terminer avant que le prochain ne s’exécute. Vous pouvez également utiliser le paramètre « Exécuter les scripts d’ouverture de session simultanément » pour obliger le système à attendre la fin des scripts d’ouverture de session avant de charger le Bureau.
Un intervalle trop long peut retarder le système et incommoder les utilisateurs. Cependant, si l’intervalle est trop court, des tâches requises peuvent ne pas être exécutées et le système peut sembler être prêt prématurément.
Si vous désactivez ou ne configurez pas ce paramètre, le système attend que le jeu de scripts s’exécute pendant 600 secondes maximum (10 minutes). Il s’agit du comportement par défaut.
Registry
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System- Value name
- not defined in the ADMX
Enable / disable values: not defined in the ADMX (see the options below).
PowerShell
PowerShell commands that write to the registry what the policy would write. Values in angle brackets (<…>) must be replaced.
Writing directly to the registry bypasses Group Policy: if a GPO manages this value, it will be rewritten at the next gpupdate; otherwise the value stays in place (the "tattooing" effect). Prefer a GPO or, locally, LGPO.exe. Run PowerShell as administrator for HKLM. Some policies need a restart or gpupdate /force.
Enable
# Enable: Scripts/MaxGPOScriptWaitPolicy
$k = 'HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\System'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
# Seconds
Set-ItemProperty -Path $k -Name 'MaxGPOScriptWait' -Value 600 -Type DWord # maximum 32000Disable
# Disable: Scripts/MaxGPOScriptWaitPolicy
# No value is written in the "Disabled" state (nothing defined in the ADMX)Revert to "Not configured"
# Revert to "Not configured": Scripts/MaxGPOScriptWaitPolicy
$k = 'HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\System'
Remove-ItemProperty -Path $k -Name 'MaxGPOScriptWait' -ErrorAction SilentlyContinueOptions (1)
| Label | Control | Registry value | REG type | Constraints / details |
|---|---|---|---|---|
| Seconds:Secondes :MaxGPOScriptWait | Numeric boxdecimal | MaxGPOScriptWait | REG_DWORD | Required · Max: 32000 · Default (UI): 600 |