Prompt users when they delete multiple OneDrive files on their local computer
Explanation
This policy sets the threshold for how many files a user can delete from a local OneDrive folder before the user is notified that the files will also be deleted from the cloud.
If you enable this policy, users will see a notification if they delete more than the specified number of files from OneDrive on their local computer. The user will be given the option to continue to remove the cloud files, or restore the local files.
Note: Even if you enable this policy, users won't receive notifications if they've selected the "Always remove files" check box on a previous notification, or if they've cleared the "Notify me when many files are deleted in the cloud" check box in OneDrive sync app settings.
If you disable this policy, users will not receive a notification when they delete numerous OneDrive files on their local computer.
If you do not configure this policy, users will see a notification when they delete more than 200 files within a short period of time.
Registry
HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\OneDrive- 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: OneDrive/LocalMassDeleteFileDeleteThreshold
$k = 'HKLM:\SOFTWARE\Policies\Microsoft\OneDrive'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
# Number of files
Set-ItemProperty -Path $k -Name 'LocalMassDeleteFileDeleteThreshold' -Value 200 -Type DWord # between 0 and 100000Disable
# Disable: OneDrive/LocalMassDeleteFileDeleteThreshold
# No value is written in the "Disabled" state (nothing defined in the ADMX)Revert to "Not configured"
# Revert to "Not configured": OneDrive/LocalMassDeleteFileDeleteThreshold
$k = 'HKLM:\SOFTWARE\Policies\Microsoft\OneDrive'
Remove-ItemProperty -Path $k -Name 'LocalMassDeleteFileDeleteThreshold' -ErrorAction SilentlyContinueOptions (1)
| Label | Control | Registry value | REG type | Constraints / details |
|---|---|---|---|---|
| Number of files:LMDFileDeleteThresholdBox | Numeric boxdecimal | LocalMassDeleteFileDeleteThreshold | REG_DWORD | Min: 0 · Max: 100000 · Default (UI): 200 |
Application
Microsoft OneDrive (Microsoft) — October 2026 templates
October 2026 templates from pl4nty/web-admx-tool.