en-US onedrive user

Set the default location for the OneDrive folder

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

Microsoft OneDrive 26.150.0804.0011

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 set a specific path as the default location of the OneDrive folder on users' computers. By default, the path is under %userprofile%. If you enable this setting, the default location of the OneDrive - {organization name} folder will be the path that you specify in the OneDrive.admx file. To prevent users from changing the location you specify, enable the "Prevent users from changing the location of their OneDrive folder" setting. If you disable or do not configure this setting, the default location of the OneDrive - {organization name} folder will be in %userprofile%.

Registry

HKCU SOFTWARE\Policies\Microsoft\OneDrive

Value name: DefaultRootDir

More options available

Options

Path:
List (registry values) list
- list under Software\Policies\Microsoft\OneDrive\DefaultRootDir

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: Set the default location for the OneDrive folder
; State: Enabled
; Supported on: At least Windows Server 2008 R2 or Windows 7

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

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

PowerShell

# Exported from gporais.com
# Policy: Set the default location for the 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 'DefaultRootDir' -Value 1 -Type DWord

$path = 'HKCU:\Software\Policies\Microsoft\OneDrive\DefaultRootDir'
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