ログ ファイルが最大サイズに達したときのイベント ログの動作を制御する のレジストリ値 Retention (System)コンピューターHKLM\Software\Policies\Microsoft\Windows\EventLog\System

ポリシー ID
Channel_Log_Retention_4
適用対象
コンピューターの構成
サポートされるバージョン
Windows Vista 以降
出典
Administrative Templates (.admx) for Windows 11 2026 Update (26H2) (バージョン 1.0)
カテゴリ
Windows コンポーネント › イベント ログ サービス › システム

レジストリ

Retention

REG_SZコンピューター
有効時の値
1
無効時の値
0
.reg · CMD · PowerShell で適用する
.reg
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\EventLog\System]

; 選択項目 (1 つだけ使用)
; 有効
"Retention"="1"
; 無効
"Retention"="0"
CMD
:: 選択項目 (1 つだけ使用)

:: 有効
reg add "HKLM\Software\Policies\Microsoft\Windows\EventLog\System" /v "Retention" /t REG_SZ /d 1 /f
:: 無効
reg add "HKLM\Software\Policies\Microsoft\Windows\EventLog\System" /v "Retention" /t REG_SZ /d 0 /f
PowerShell
# 共通: キーを作成
New-Item -Path 'HKLM:\Software\Policies\Microsoft\Windows\EventLog\System' -Force | Out-Null

# 選択項目 (1 つだけ使用)
# 有効
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\EventLog\System' -Name 'Retention' -PropertyType String -Value '1' -Force | Out-Null
# 無効
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\EventLog\System' -Name 'Retention' -PropertyType String -Value '0' -Force | Out-Null