Open in the explorer

Configure Background Sync

Configurer la synchronisation en arrière-plan

Type
Computer
GPO path
Computer Configuration › Policies › Administrative Templates › Network › Offline Files FR: Configuration ordinateur › Stratégies › Modèles d'administration › Réseau › Fichiers hors connexion
Supported on
At least Windows Server 2008 R2 or Windows 7 FR: Au minimum Windows Server 2008 R2 ou Windows 7
ADMX file
OfflineFiles.admx
Internal name
OfflineFiles/Pol_BackgroundSyncSettings

Explanation

This policy setting controls when background synchronization occurs while operating in slow-link mode, and applies to any user who logs onto the specified machine while this policy is in effect. To control slow-link mode, use the "Configure slow-link mode" policy setting.

If you enable this policy setting, you can control when Windows synchronizes in the background while operating in slow-link mode. Use the 'Sync Interval' and 'Sync Variance' values to override the default sync interval and variance settings. Use 'Blockout Start Time' and 'Blockout Duration' to set a period of time where background sync is disabled. Use the 'Maximum Allowed Time Without A Sync' value to ensure that all network folders on the machine are synchronized with the server on a regular basis.

You can also configure Background Sync for network shares that are in user selected Work Offline mode. This mode is in effect when a user selects the Work Offline button for a specific share. When selected, all configured settings will apply to shares in user selected Work Offline mode as well.

If you disable or do not configure this policy setting, Windows performs a background sync of offline folders in the slow-link mode at a default interval with the start of the sync varying between 0 and 60 additional minutes. In Windows 7 and Windows Server 2008 R2, the default sync interval is 360 minutes. In Windows 8 and Windows Server 2012, the default sync interval is 120 minutes.

French text from Windows 11 26H2

Ce paramètre de stratégie détermine le moment de la synchronisation en arrière-plan pendant un fonctionnement en mode de liaison lente, lequel s’applique à tous les utilisateurs qui ouvrent une session sur un ordinateur lorsque cette stratégie est appliquée. Pour contrôler le mode de liaison lente, utilisez le paramètre de stratégie « Configurer le mode de liaison lente ».

Si vous activez ce paramètre de stratégie, vous pouvez spécifier quand Windows procède à une synchronisation en arrière-plan lorsque le mode de liaison lente est en vigueur. Utilisez les valeurs « Intervalle de synchronisation » et « Écart de synchronisation » pour remplacer les paramètres par défaut. Utilisez les valeurs « Heure de début du blocage » et « Durée du blocage » pour définir la durée pendant laquelle la synchronisation en arrière-plan est désactivée. Utilisez la valeur « Durée maximale autorisée sans synchronisation » pour vous assurer que tous les dossiers réseau de l’ordinateur sont régulièrement synchronisés avec le serveur.

Vous pouvez également configurer la synchronisation d’arrière-plan pour les partages réseau placés en mode Travailler hors connexion par les utilisateurs. Ce mode est appliqué lorsqu’un utilisateur sélectionne le bouton Travailler hors connexion pour un partage spécifique. Dans ce cas, tous les paramètres configurés s’appliquent également aux partages placés en mode Travailler hors connexion par les utilisateurs.

Si vous désactivez ce paramètre de stratégie ou si vous ne le configurez pas, Windows effectue une synchronisation en arrière-plan des dossiers hors connexion en mode de liaison lente à un intervalle par défaut avec un début de synchronisation variable entre 0 et 60 minutes supplémentaires. Dans Windows 7 et Windows Server 2008 R2, l’intervalle de synchronisation par défaut est de 360 minutes. Dans Windows 8 et Windows Server 2012, l’intervalle de synchronisation par défaut est de 120 minutes.

Registry

HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\NetCache
Value name
BackgroundSyncEnabled
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: OfflineFiles/Pol_BackgroundSyncSettings
$k = 'HKLM:\Software\Policies\Microsoft\Windows\NetCache'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'BackgroundSyncEnabled' -Value 1 -Type DWord
# Sync Interval (minutes)
Set-ItemProperty -Path $k -Name 'BackgroundSyncPeriodMin' -Value 360 -Type DWord  # between 1 and 1440
# Sync Variance (minutes)
Set-ItemProperty -Path $k -Name 'BackgroundSyncMaxStartMin' -Value 60 -Type DWord  # between 0 and 3600
# Maximum Allowed Time Without A Sync (minutes)
Set-ItemProperty -Path $k -Name 'BackgroundSyncIgnoreBlockOutAfterMin' -Value 0 -Type DWord  # between 0 and 4294967295
# Blockout Start Time (HHMM)
Set-ItemProperty -Path $k -Name 'BackgroundSyncBlockOutStartTime' -Value 0 -Type DWord  # between 0 and 2400
# Blockout Duration (minutes)
Set-ItemProperty -Path $k -Name 'BackgroundSyncBlockOutDurationMin' -Value 0 -Type DWord  # between 0 and 1440
# Enable Background Sync for shares in user selected "Work Offline" mode
# unchecked: 0
Set-ItemProperty -Path $k -Name 'BackgroundSyncEnabledForForcedOffline' -Value 1 -Type DWord

Disable

# Disable: OfflineFiles/Pol_BackgroundSyncSettings
$k = 'HKLM:\Software\Policies\Microsoft\Windows\NetCache'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'BackgroundSyncEnabled' -Value 0 -Type DWord

Revert to "Not configured"

# Revert to "Not configured": OfflineFiles/Pol_BackgroundSyncSettings
$k = 'HKLM:\Software\Policies\Microsoft\Windows\NetCache'
Remove-ItemProperty -Path $k -Name 'BackgroundSyncEnabled' -ErrorAction SilentlyContinue
Remove-ItemProperty -Path $k -Name 'BackgroundSyncPeriodMin' -ErrorAction SilentlyContinue
Remove-ItemProperty -Path $k -Name 'BackgroundSyncMaxStartMin' -ErrorAction SilentlyContinue
Remove-ItemProperty -Path $k -Name 'BackgroundSyncIgnoreBlockOutAfterMin' -ErrorAction SilentlyContinue
Remove-ItemProperty -Path $k -Name 'BackgroundSyncBlockOutStartTime' -ErrorAction SilentlyContinue
Remove-ItemProperty -Path $k -Name 'BackgroundSyncBlockOutDurationMin' -ErrorAction SilentlyContinue
Remove-ItemProperty -Path $k -Name 'BackgroundSyncEnabledForForcedOffline' -ErrorAction SilentlyContinue

Options (6)

LabelControlRegistry valueREG typeConstraints / details
Sync Interval (minutes)Intervalle de synchronisation (minutes)Lbl_BackgroundSyncDefaultSyncTimeNumeric boxdecimalBackgroundSyncPeriodMinREG_DWORD
Min: 1 · Max: 1440 · Default (UI): 360
Sync Variance (minutes)Écart de synchronisation (minutes)Lbl_BackgroundSyncVarianceNumeric boxdecimalBackgroundSyncMaxStartMinREG_DWORD
Min: 0 · Max: 3600 · Default (UI): 60
Maximum Allowed Time Without A Sync (minutes)Durée maximale autorisée sans synchronisation (minutes)Lbl_BackgroundSyncIgnoreBlockOutTimeNumeric boxdecimalBackgroundSyncIgnoreBlockOutAfterMinREG_DWORD
Min: 0 · Max: 4294967295 · Default (UI): 0
Blockout Start Time (HHMM)Heure de début du blocage (HHMM)Lbl_BackgroundSyncBlockOutPeriodStartTimeNumeric boxdecimalBackgroundSyncBlockOutStartTimeREG_DWORD
Min: 0 · Max: 2400 · Default (UI): 0
Blockout Duration (minutes)Durée du blocage (minutes)Lbl_BackgroundSyncBlockOutPeriodDurationNumeric boxdecimalBackgroundSyncBlockOutDurationMinREG_DWORD
Min: 0 · Max: 1440 · Default (UI): 0
Enable Background Sync for shares in user selected "Work Offline" modeActiver la synchronisation en arrière-plan pour les partages placés en mode de travail hors connexion par l’utilisateurLbl_BackgroundSyncInForcedOfflineCheck boxbooleanBackgroundSyncEnabledForForcedOfflineREG_DWORD
Checked: REG_DWORD = 1
Unchecked: REG_DWORD = 0

Availability