How to Customize OneDrive Sync Root Folder Name via Intune
Customize OneDrive Sync Root Folder Name via Intune
If your organization name is long, OneDrive’s default sync folder name is probably quietly causing problems. By default, OneDrive creates a local folder called OneDrive – {Your Organization Name}. For orgs with verbose names, that eats into Windows’ path limit before a user even creates a subfolder.
The fix is a single policy deployed through Intune. Here’s how to set it up.
Why This Matters
Windows has a well-known path length limitation. The OneDrive sync root path alone cannot exceed 120 characters. Once you add folder and file names on top of a long org name, you hit that ceiling fast — and OneDrive starts throwing sync errors that are frustrating to troubleshoot.
Shortening the root folder name is one of the easiest ways to reclaim usable path length across your entire fleet. Microsoft documents this limit in the OneDrive sync app release notes.
What You Need Before Starting
-
Intune admin access (minimum role: Policy and Profile Manager)
-
Windows devices enrolled in Intune
-
OneDrive sync app installed on target devices
-
Your Azure AD Tenant ID — find it at Entra ID → Overview → Properties
Step 1: Import the ADMX Templates
This policy lives in the Imported Administrative Templates (Preview) profile type — not the Settings Catalog. So you need to import the ADMX files first.
Order matters. OneDrive.admx depends on Windows.admx. Import them in this sequence:
1. Import Windows.admx
-
Download the Windows 11 25H2 Administrative Templates from Microsoft
-
In Intune, go to Devices → Configuration → Import ADMX
-
Upload
Windows.admxand its companionWindows.admlfile
2. Import OneDrive.admx
-
On any device with OneDrive installed, navigate to:
C:\Program Files\Microsoft OneDrive\<version>\adm\ -
Upload
OneDrive.admxandOneDrive.admlthe same way -
Refer to Microsoft’s ADMX import guide for full steps
If you skip Windows.admx first, Intune throws:
NamespaceMissing: Microsoft.Policies.Windows. Please upload it first.
Step 2: Create the Configuration Policy
-
Go to Intune admin center → Devices → Windows → Configuration → Create → New Policy
-
Set Platform to
Windows 10 and later -
Set Profile type to
Templates -
Select Imported Administrative Templates (Preview)
-
Navigate to Computer Configuration → OneDrive
-
Find Set a custom name for the OneDrive folder and set it to Enabled
-
Enter your Tenant ID and your chosen custom folder name
-
Assign to a pilot group first before broad deployment
Microsoft’s official reference for this policy is documented in the OneDrive policies list.
Naming Rules
Keep the name short and clean. A few rules to follow:
-
Must be at least one character long
-
Cannot be literally named
OneDrive -
No invalid Windows folder characters
-
Full sync root path must stay under 120 characters
A short acronym or brand name works best — something like Cloud, Contoso, or your company abbreviation.
Step 3: Verify It Applied
On a managed device, check this registry key:
HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\OneDrive\CustomSyncRootFolderName
The value should show the custom folder name you configured. If it’s not there yet, trigger a policy sync from Settings → Accounts → Access work or school → Info → Sync.
Heads Up: Existing Users Must Relink
The policy applies automatically only for new OneDrive setups. Users who already have OneDrive synced need to unlink and relink their account:
-
Click the OneDrive tray icon → Settings (⚙️) → Account
-
Click Unlink this PC → Unlink account
-
Sign back in — OneDrive will now use the new folder name
Plan this for a maintenance window or communicate it clearly to affected users. Microsoft covers the relink process in the OneDrive support documentation.
PowerShell Alternative
Prefer scripts over ADMX templates? Deploy this via Intune as a Platform Script:
$TenantId = "your-tenant-id-here"
$FolderName = "Cloud"
$KeyPath = "HKLM:\SOFTWARE\Policies\Microsoft\OneDrive\CustomSyncRootFolderName"
if (-not (Test-Path $KeyPath)) {
New-Item -Path $KeyPath -Force | Out-Null
}
New-ItemProperty -Path $KeyPath -Name $TenantId -Value $FolderName -PropertyType String -Force | Out-Null
Replace $TenantId and $FolderName with your values. Test on a pilot group before pushing fleet-wide.
Best Practices
-
Deploy before onboarding new devices. If OneDrive is already set up, users need to relink — which adds overhead at scale.
-
Keep the name short. The whole point is reducing path length, so don’t use a 30-character name.
-
Pair with the default folder location policy if path length is a wider issue — both settings together give you full control over where OneDrive lands on disk.
This is a small change with a real impact on sync reliability, especially in environments with deeply nested folder structures or long file names.
