Open in the explorer

Prevent users from changing the location of their OneDrive folder

Type
User
GPO path
User Configuration › Policies › Administrative Templates › OneDrive
Supported on
At least Windows Server 2008 R2 or Windows 7
ADMX file
OneDrive.admx
Internal name
OneDrive/DisableCustomRoot

Explanation

This setting lets you block users from changing the location of their OneDrive - {organization name} folder during setup of the OneDrive sync app.

If you enable this setting, the "Change location" link is hidden in OneDrive Setup. The OneDrive folder will be created in the default location, or in the custom location you specified if you enabled the "Set the default location for the OneDrive folder" setting.

If you disable or do not configure this setting, users can click the "Change location" link to change the location of their OneDrive folder in OneDrive Setup.

Registry

HKEY_CURRENT_USER\SOFTWARE\Policies\Microsoft\OneDrive
Value name
DisableCustomRoot
StateValue written
Enablednot defined in the ADMX (see the options below)
Disablednot 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.

The ADMX does not specify the value written when enabled; the GPO editor usually writes REG_DWORD 1 (enabled) / 0 (disabled). The commands below use 1/0 as an assumption.

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/DisableCustomRoot
$k = 'HKCU:\SOFTWARE\Policies\Microsoft\OneDrive'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
# The ADMX does not specify the value written; the GPO editor usually writes REG_DWORD 1 (enabled) / 0 (disabled)
Set-ItemProperty -Path $k -Name 'DisableCustomRoot' -Value 1 -Type DWord  # assumed value (not defined in the ADMX)
$k = 'HKCU:\Software\Policies\Microsoft\OneDrive\DisableCustomRoot'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
# Change location setting
$items = @{
    '<name1>' = '<value1>'
    '<name2>' = '<value2>'
}  # Replace the values with your own
$items.GetEnumerator() | ForEach-Object { Set-ItemProperty -Path $k -Name $_.Key -Value $_.Value -Type String }

Disable

# Disable: OneDrive/DisableCustomRoot
$k = 'HKCU:\SOFTWARE\Policies\Microsoft\OneDrive'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
# The ADMX does not specify the value written; the GPO editor usually writes REG_DWORD 1 (enabled) / 0 (disabled)
Set-ItemProperty -Path $k -Name 'DisableCustomRoot' -Value 0 -Type DWord  # assumed value (not defined in the ADMX)

Revert to "Not configured"

# Revert to "Not configured": OneDrive/DisableCustomRoot
$k = 'HKCU:\SOFTWARE\Policies\Microsoft\OneDrive'
Remove-ItemProperty -Path $k -Name 'DisableCustomRoot' -ErrorAction SilentlyContinue
$k = 'HKCU:\Software\Policies\Microsoft\OneDrive\DisableCustomRoot'
Remove-Item -Path $k -Recurse -Force -ErrorAction SilentlyContinue

Options (1)

LabelControlRegistry valueREG typeConstraints / details
Change location setting:DisableCustomRootListList (table)listSoftware\Policies\Microsoft\OneDrive\DisableCustomRootName = value pairs · additiveREG_SZ (values under the key)

Application

Microsoft OneDrive (Microsoft) — October 2026 templates

October 2026 templates from pl4nty/web-admx-tool.