Run logon scripts synchronously
Exécuter les scripts d’ouverture de session simultanément
Explanation
This policy setting directs the system to wait for logon scripts to finish running before it starts the File Explorer interface program and creates the desktop.
If you enable this policy setting, File Explorer does not start until the logon scripts have finished running. This policy setting ensures that logon script processing is complete before the user starts working, but it can delay the appearance of the desktop.
If you disable or do not configure this policy setting, the logon scripts and File Explorer are not synchronized and can run simultaneously.
This policy setting appears in the Computer Configuration and User Configuration folders. The policy setting set in Computer Configuration takes precedence over the policy setting set in User Configuration.
Ce paramètre de stratégie indique au système qu’il doit attendre la fin de l’exécution des scripts d’ouverture de session avant de démarrer l’interface de l’Explorateur de fichiers et de créer le Bureau.
Si vous activez ce paramètre de stratégie, l’Explorateur de fichiers ne démarre pas tant que l’exécution des scripts d’ouverture de session n’est pas terminée. Ce paramètre de stratégie permet de s’assurer que le traitement des scripts d’ouverture de session est terminé avant que l’utilisateur ne commence à travailler, mais il peut retarder l’apparition du Bureau.
Si vous désactivez ou ne configurez pas ce paramètre, les scripts d’ouverture de session et l’Explorateur de fichiers ne sont pas synchronisés et peuvent s’exécuter simultanément.
Ce paramètre de stratégie apparaît dans les dossiers Configuration ordinateur et Configuration utilisateur. Le paramètre de stratégie défini dans Configuration ordinateur prévaut sur celui qui est défini dans Configuration utilisateur.
Registry
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System- Value name
RunLogonScriptSync
| 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: Scripts/Run_Logon_Script_Sync_2
$k = 'HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\System'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'RunLogonScriptSync' -Value 1 -Type DWordDisable
# Disable: Scripts/Run_Logon_Script_Sync_2
$k = 'HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\System'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'RunLogonScriptSync' -Value 0 -Type DWordRevert to "Not configured"
# Revert to "Not configured": Scripts/Run_Logon_Script_Sync_2
$k = 'HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\System'
Remove-ItemProperty -Path $k -Name 'RunLogonScriptSync' -ErrorAction SilentlyContinue