Diagnostics: Configure scenario retention: registry value DataRetentionBySizeEnabled and 1 moreComputerHKLM\SOFTWARE\Policies\Microsoft\Windows\WDI
- Policy ID
- WdiDpsScenarioDataSizeLimitPolicy
- Scope
- Computer Configuration
- Supported on
- At least Windows Vista
- Source
- Administrative Templates (.admx) for Windows 11 2026 Update (26H2) (version 1.0)
- Category
- System › Troubleshooting and Diagnostics
Registry
DataRetentionBySizeEnabled
REG_DWORDComputerHKLM\SOFTWARE\Policies\Microsoft\Windows\WDI Current key
- Enabled value
- 1
- Disabled value
- 0
Apply with .reg · CMD · PowerShell
.reg
Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WDI] ; Options (use only one) ; Enabled "DataRetentionBySizeEnabled"=dword:00000001 ; Disabled "DataRetentionBySizeEnabled"=dword:00000000
CMD
:: Options (use only one) :: Enabled reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WDI" /v "DataRetentionBySizeEnabled" /t REG_DWORD /d 1 /f :: Disabled reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WDI" /v "DataRetentionBySizeEnabled" /t REG_DWORD /d 0 /f
PowerShell
# Common: create the key New-Item -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\WDI' -Force | Out-Null # Options (use only one) # Enabled New-ItemProperty -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\WDI' -Name 'DataRetentionBySizeEnabled' -PropertyType DWord -Value 1 -Force | Out-Null # Disabled New-ItemProperty -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\WDI' -Name 'DataRetentionBySizeEnabled' -PropertyType DWord -Value 0 -Force | Out-Null
DirSizeLimit
REG_DWORDComputerHKLM\SOFTWARE\Policies\Microsoft\Windows\WDI Current key
- Enabled value
- Depends on the option value
- Element
- Scenario data size limit (in MB)
- Value type
- REG_DWORD
- Required
- true
Apply with .reg · CMD · PowerShell
.reg
Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WDI] ; Value names and types follow the ADMX. Replace <enter value> below with your own data "DirSizeLimit"=dword:<enter value>
CMD
:: Value names and types follow the ADMX. Replace <enter value> below with your own data reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WDI" /v "DirSizeLimit" /t REG_DWORD /d "<enter value>" /f
PowerShell
# Value names and types follow the ADMX. Replace <enter value> below with your own data New-Item -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\WDI' -Force | Out-Null New-ItemProperty -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\WDI' -Name 'DirSizeLimit' -PropertyType DWord -Value '<enter value>' -Force | Out-Null