Turn on logging
Activer la journalisation
Explanation
This policy setting turns on logging.
If you enable or do not configure this policy setting, then events can be written to this log.
If the policy setting is disabled, then no new events can be logged. Events can always be read from the log, regardless of this policy setting.
Ce paramètre de stratégie active la journalisation.
Si vous activez ce paramètre de stratégie ou ne le configurez pas, les événements peuvent être écrits dans ce journal.
Si vous désactivez ce paramètre de stratégie, aucun nouvel événement ne peut être enregistré. Les événements peuvent toujours être lus depuis le journal, quelle que soit la valeur de ce paramètre de stratégie.
Registry
HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\EventLog\Setup- Value name
Enabled
| State | Value written |
|---|---|
| Enabled | REG_SZ = 1 |
| Disabled | REG_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_LogEnabled
$k = 'HKLM:\Software\Policies\Microsoft\Windows\EventLog\Setup'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'Enabled' -Value '1' -Type StringDisable
# Disable: EventLog/Channel_LogEnabled
$k = 'HKLM:\Software\Policies\Microsoft\Windows\EventLog\Setup'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'Enabled' -Value '0' -Type StringRevert to "Not configured"
# Revert to "Not configured": EventLog/Channel_LogEnabled
$k = 'HKLM:\Software\Policies\Microsoft\Windows\EventLog\Setup'
Remove-ItemProperty -Path $k -Name 'Enabled' -ErrorAction SilentlyContinue