Configure Logon Script Delay
Configurer le délai des scripts d’ouverture de session
Explanation
Enter “0” to disable Logon Script Delay.
This policy setting allows you to configure how long the Group Policy client waits after logon before running scripts.
By default, the Group Policy client waits five minutes before running logon scripts. This helps create a responsive desktop environment by preventing disk contention.
If you enable this policy setting, Group Policy will wait for the specified amount of time before running logon scripts.
If you disable this policy setting, Group Policy will run scripts immediately after logon.
If you do not configure this policy setting, Group Policy will wait five minutes before running logon scripts.
Entrez « 0 » pour désactiver le délai de script d'ouverture de session.
Ce paramètre de stratégie vous permet de configurer la durée d'attente du client de stratégie de groupe après l'ouverture de session avant l'exécution des scripts.
Par défaut, le client de stratégie de groupe attend cinq minutes avant d'exécuter des scripts d'ouverture de session. Cela permet de créer un environnement de bureau réactif en empêchant la contention du disque.
Si vous activez ce paramètre de stratégie, la stratégie de groupe attend la durée spécifiée avant d'exécuter des scripts d'ouverture de session.
Si vous désactivez ce paramètre de stratégie, la stratégie de groupe exécute les scripts immédiatement après l'ouverture de session.
Si vous ne configurez pas ce paramètre de stratégie, la stratégie de groupe attend cinq minutes avant d'exécuter des scripts d'ouverture de session.
Registry
HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\System- Value name
EnableLogonScriptDelay
| State | Value written |
|---|---|
| Enabled | REG_DWORD = 1 |
| Disabled | REG_DWORD = 0 |
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: GroupPolicy/LogonScriptDelay
$k = 'HKLM:\Software\Policies\Microsoft\Windows\System'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'EnableLogonScriptDelay' -Value 1 -Type DWord
# minute
Set-ItemProperty -Path $k -Name 'AsyncScriptDelay' -Value 5 -Type DWord # maximum 1000Disable
# Disable: GroupPolicy/LogonScriptDelay
$k = 'HKLM:\Software\Policies\Microsoft\Windows\System'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'EnableLogonScriptDelay' -Value 0 -Type DWordRevert to "Not configured"
# Revert to "Not configured": GroupPolicy/LogonScriptDelay
$k = 'HKLM:\Software\Policies\Microsoft\Windows\System'
Remove-ItemProperty -Path $k -Name 'EnableLogonScriptDelay' -ErrorAction SilentlyContinue
Remove-ItemProperty -Path $k -Name 'AsyncScriptDelay' -ErrorAction SilentlyContinueOptions (1)
| Label | Control | Registry value | REG type | Constraints / details |
|---|---|---|---|---|
| minute:minute :AsyncScriptDelay1 | Numeric boxdecimal | AsyncScriptDelay | REG_DWORD | Max: 1000 · Default (UI): 5 |