en-US onedrive user

Prevent users from changing the location of their OneDrive folder

Verified with Microsoft OneDrive 26.153.0809.0004 — updated on July 10, 2026

Microsoft OneDrive 26.153.0809.0004

Supported on: At least Windows Server 2008 R2 or Windows 7

Path in the GPO console

User Configuration\Administrative Templates\OneDrive

Description

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

HKCU SOFTWARE\Policies\Microsoft\OneDrive

Value name: DisableCustomRoot

More options available

Options

Change location setting:
List (registry values) list
- list under Software\Policies\Microsoft\OneDrive\DisableCustomRoot

Export Builder

BETA

Configure the state, scope and options, then generate .reg, PowerShell, Intune and SCCM outputs — or add the setting to a multi-setting collection.

These exports write the registry — this is not a managed GPO.

.reg file

Windows Registry Editor Version 5.00

; Exported from gporais.com
; Policy: Prevent users from changing the location of their OneDrive folder
; State: Enabled
; Supported on: At least Windows Server 2008 R2 or Windows 7

[HKEY_CURRENT_USER\SOFTWARE\Policies\Microsoft\OneDrive]
"DisableCustomRoot"=dword:00000001

[HKEY_CURRENT_USER\Software\Policies\Microsoft\OneDrive\DisableCustomRoot]
; List values: enter one value per line in the builder UI.
More formats (PowerShell, Intune, SCCM)

PowerShell

# Exported from gporais.com
# Policy: Prevent users from changing the location of their OneDrive folder
# State: Enabled
# Supported on: At least Windows Server 2008 R2 or Windows 7
# Warning: In SYSTEM context (the Intune default), HKCU targets the SYSTEM profile. Run this script using the logged-on credentials.

$path = 'HKCU:\SOFTWARE\Policies\Microsoft\OneDrive'
New-Item -Path $path -Force | Out-Null
Set-ItemProperty -Path $path -Name 'DisableCustomRoot' -Value 1 -Type DWord

$path = 'HKCU:\Software\Policies\Microsoft\OneDrive\DisableCustomRoot'
New-Item -Path $path -Force | Out-Null
# List values: enter one value per line in the builder UI.

Building a multi-setting collection? Add this setting and generate combined .reg / PowerShell / GPO scripts.

Open the Builder

Embed this policy on your site

What to embed
Theme

Adds one script line: the theme follows your site’s appearance and the height fits the content. If your site blocks scripts, the embed follows the visitor’s system theme.

Preview