Open in the explorer

Configure Logon Script Delay

Configurer le délai des scripts d’ouverture de session

Type
Computer
GPO path
Computer Configuration › Policies › Administrative Templates › System › Group Policy FR: Configuration ordinateur › Stratégies › Modèles d'administration › Système › Stratégie de groupe
Supported on
At least Windows Server 2012 R2, Windows 8.1 or Windows RT 8.1 FR: Au minimum Windows Server 2012 R2, Windows 8.1 ou Windows RT 8.1
ADMX file
GroupPolicy.admx
Internal name
GroupPolicy/LogonScriptDelay

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.

French text from Windows 11 26H2

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
StateValue written
EnabledREG_DWORD = 1
DisabledREG_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 1000

Disable

# 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 DWord

Revert 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 SilentlyContinue

Options (1)

LabelControlRegistry valueREG typeConstraints / details
minute:minute :AsyncScriptDelay1Numeric boxdecimalAsyncScriptDelayREG_DWORD
Max: 1000 · Default (UI): 5

Availability