Configure root certificate clean up: registry value RootCertificateCleanupOptionComputerHKLM\SOFTWARE\Policies\Microsoft\Windows\CertProp

Policy ID
CertPropRootCleanupString
Scope
Computer Configuration
Supported on
At least Windows Vista
Source
Administrative Templates (.admx) for Windows 11 2026 Update (26H2) (version 1.0)
Category
Windows Components › Smart Card

Registry

RootCertificateCleanupOption

REG_DWORDComputer
Enabled value
Depends on the option value
Element
Root certificate clean up options
Options
ItemStored value
No cleanup0
Clean up certificates on smart card removal1
Clean up certificates on log off2
Apply with .reg · CMD · PowerShell
.reg
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CertProp]

; Options (use only one)
; No cleanup
"RootCertificateCleanupOption"=dword:00000000
; Clean up certificates on smart card removal
"RootCertificateCleanupOption"=dword:00000001
; Clean up certificates on log off
"RootCertificateCleanupOption"=dword:00000002
CMD
:: Options (use only one)

:: No cleanup
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\CertProp" /v "RootCertificateCleanupOption" /t REG_DWORD /d 0 /f
:: Clean up certificates on smart card removal
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\CertProp" /v "RootCertificateCleanupOption" /t REG_DWORD /d 1 /f
:: Clean up certificates on log off
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\CertProp" /v "RootCertificateCleanupOption" /t REG_DWORD /d 2 /f
PowerShell
# Common: create the key
New-Item -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\CertProp' -Force | Out-Null

# Options (use only one)
# No cleanup
New-ItemProperty -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\CertProp' -Name 'RootCertificateCleanupOption' -PropertyType DWord -Value 0 -Force | Out-Null
# Clean up certificates on smart card removal
New-ItemProperty -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\CertProp' -Name 'RootCertificateCleanupOption' -PropertyType DWord -Value 1 -Force | Out-Null
# Clean up certificates on log off
New-ItemProperty -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\CertProp' -Name 'RootCertificateCleanupOption' -PropertyType DWord -Value 2 -Force | Out-Null