Open in the explorer

Back up log automatically when full

Sauvegarder le journal automatiquement lorsqu’il est plein

Type
Computer
GPO path
Computer Configuration › Policies › Administrative Templates › Windows Components › Event Log Service › Security FR: Configuration ordinateur › Stratégies › Modèles d'administration › Composants Windows › Service Journal des événements › Sécurité
Supported on
At least Windows Vista FR: Au minimum Windows Vista
ADMX file
EventLog.admx
Internal name
EventLog/Channel_Log_AutoBackup_2

Explanation

This policy setting controls Event Log behavior when the log file reaches its maximum size and takes effect only if the "Retain old events" policy setting is enabled.

If you enable this policy setting and the "Retain old events" policy setting is enabled, the Event Log file is automatically closed and renamed when it is full. A new file is then started.

If you disable this policy setting and the "Retain old events" policy setting is enabled, new events are discarded and old events are retained.

If you do not configure this policy setting and the "Retain old events" policy setting is enabled, new events are discarded and the old events are retained.

French text from Windows 11 26H2

Ce paramètre de stratégie contrôle le comportement du journal des événements lorsque le fichier journal atteint sa taille maximale et s’applique uniquement si le paramètre de stratégie « Conserver les anciens événements » est activé.

Si vous activez ce paramètre de stratégie et si le paramètre de stratégie « Conserver les anciens événements » est activé, le fichier journal des événements est automatiquement fermé et renommé lorsqu’il est plein. Un nouveau fichier est alors démarré.

Si vous désactivez ce paramètre de stratégie et si le paramètre de stratégie « Conserver les anciens événements » est activé, les nouveaux événements sont ignorés et les anciens événements sont conservés.

Si vous ne configurez pas ce paramètre de stratégie et si le paramètre de stratégie « Conserver les anciens événements » est activé, les nouveaux événements sont ignorés et les anciens événements sont conservés.

Registry

HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\EventLog\Security
Value name
AutoBackupLogFiles
StateValue written
EnabledREG_SZ = 1
DisabledREG_SZ = 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: EventLog/Channel_Log_AutoBackup_2
$k = 'HKLM:\Software\Policies\Microsoft\Windows\EventLog\Security'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'AutoBackupLogFiles' -Value '1' -Type String

Disable

# Disable: EventLog/Channel_Log_AutoBackup_2
$k = 'HKLM:\Software\Policies\Microsoft\Windows\EventLog\Security'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'AutoBackupLogFiles' -Value '0' -Type String

Revert to "Not configured"

# Revert to "Not configured": EventLog/Channel_Log_AutoBackup_2
$k = 'HKLM:\Software\Policies\Microsoft\Windows\EventLog\Security'
Remove-ItemProperty -Path $k -Name 'AutoBackupLogFiles' -ErrorAction SilentlyContinue

Availability