Control the location of the log file
Contrôler l’emplacement du fichier journal
Explanation
This policy setting controls the location of the log file. The location of the file must be writable by the Event Log service and should only be accessible to administrators.
If you enable this policy setting, the Event Log uses the path specified in this policy setting.
If you disable or do not configure this policy setting, the Event Log uses the folder %SYSTEMROOT%\System32\winevt\Logs.
Ce paramètre de stratégie contrôle l’emplacement du fichier journal. L’emplacement du fichier doit pouvoir être écrit par le service Journal des événements et ne doit être accessible qu’aux administrateurs.
Si vous activez ce paramètre de stratégie, le journal des événements utilise le chemin d’accès spécifié dans ce paramètre de stratégie.
Si vous désactivez ce paramètre de stratégie ou ne le configurez pas, le journal des événements utilise le dossier %SYSTEMROOT%\System32\winevt\Logs.
Registry
HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\EventLog\Setup- Value name
- not defined in the ADMX
Enable / disable values: not defined in the ADMX (see the options below).
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_LogFilePath_3
$k = 'HKLM:\Software\Policies\Microsoft\Windows\EventLog\Setup'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
# Log File Path
Set-ItemProperty -Path $k -Name 'File' -Value '<value>' -Type StringDisable
# Disable: EventLog/Channel_LogFilePath_3
# No value is written in the "Disabled" state (nothing defined in the ADMX)Revert to "Not configured"
# Revert to "Not configured": EventLog/Channel_LogFilePath_3
$k = 'HKLM:\Software\Policies\Microsoft\Windows\EventLog\Setup'
Remove-ItemProperty -Path $k -Name 'File' -ErrorAction SilentlyContinueOptions (1)
| Label | Control | Registry value | REG type | Constraints / details |
|---|---|---|---|---|
| Log File PathChemin d’accès du fichier journalChannel_LogFilePath | Text boxtext | File | REG_SZ |