Syntax for Onedrive.admx edits - DefaultRootDir

Steel Contributor

In the Onedrive deployment guidance we're instructed to edit the Onedrive GPO template (Onedrive.admx) to insert specific values.


For example, replacing {INSERT YOUR TENANT'S GUID HERE} with our actual tenant GUID.


The GUID part is easy, but the next customization is replacing {INSERT YOUR CHOSEN PATH HERE} with the desired path for the DefaultRootDir, i.e. the path you want Onedrive to sync to locally when the user runs through the first time setup.


My notes from BRK3081 at Ignite show a recommendation to use "%userprofile%\Onedrive - CompanyName" or a %userprofile% path.


I've had lots of success with Onedrive deployment by not enforcing that DefaultRootDir in Onedrive.admx, and just enforcing the DisableCustomRoot option instead. So the desired outcome of Onedrive syncing to %userprofile% is met, because users can't select a different location.


But I've had no success with enforcing the DefaultRootDir via GPO. Any attempt to use variables like %userprofile%, or C:\Users\%username\etc, or any other variable, fail during user setup of Onedrive.






So my question is really, what values or syntax will work for {INSERT YOUR CHOSEN PATH HERE} in the DefaultRootDir config in Onedrive.admx?

47 Replies

I was just having this exact discussion with my client earlier this week. We have not been able to get it work either.


On a related note, how many GPOs do you create? I am thinking that 3 - one for User Configuration, one for Computer config and one for Folder redirection, will provide long term maintainability, but we are having some deployment problems, and I'm wondering if it would be better to just have one. Any thoughts on this would be appreciated.

I'll have an article out next week about my approach, but in summary, let's say there's one folder redirection policy already in place. I'll create one Onedrive GPO, that contains settings to create a custom environment variable, create the Onedrive sync folder, set the Onedrive settings, and change the folder redirection to the new location (including moving the data). The GPOs are filtered/denied etc so that when users are added to the appropriate group the old one stops applying and the new one applies instead.


Separating them makes sense if it's a more complex environment or requirement, but for most cases the "migration" to Onedrive just  becomes a matter of dropping users in the group, advising them to launch Onedrive and complete initial setup, and monitoring network impact.

No OneDrive product team folks here I guess.

@Paul Cunningham


The problem is that the .admx template wrongly adds to the registry a REG_SZ instead of a REG_EXPAND_SZ, so the former does not expand the environment variable.

You can verify it by yourself, changing manually the type in the registry: you will find that REG_EXPAND_SZ works perfectly.

So the template must be edited manually to work, at least until someone at Microsoft will correct it.

Give a look to:

Hope it helps...

Thanks Salvatore, that's very interesting.


It's frustrating that we already need to edit the ADMX file to insert values, instead of being able to insert them via the GPO itself. Even more disappointing to learn that further edits to the ADMX are required to get this working.


I'll test it out. Appreciate your input.

Did you manage to get this working? I'm having the exact same problem whereby Ive populated the admx file with the Onedrive location but I get the error that Im unable to create the Onedrive folder location there.

Changing the REG_SZ to a REG_EXPAND_SZ reportedly works. Or have you already tried that?

Yeah, it's a very good point. Disappointingly, the technical folks mention that you have to make this change, yet offer no further instructions as to how to do it:

Looking to start deploying OneDrive for Business, and problems like this don't help!


What's the best place to start looking at this from scratch now? There's been a lot of changes lately.

Hi Adam,


I'd start with the information for the latest sync client. I'm also sure that during the Ignite sessions there will be more information provided (sessions and powerpoints). I'm also about to kick off a pretty complete production pilot, so I'd be happy to share my experiences if you'd like.




Hi Paul,


With the latest versions of OneDrive (0815 and beyond), we'll no longer require direct modifications to the file to enable tenant default directory settings. Admins will be able to add these settings directly in Group Policy Editor. Furthermore, ADM packages will ship with the OneDrive client installation (%localappdata%/Microsoft/OneDrive/<build version>/adm) to ensure client version to ADM package mapping. 


Let me know if you're able to try out the new ADM package and if it works for your scenarios. Currently, 0830 version has shipped to production customers which has these changes. We're working on updating our public documentation this week. 



That sounds like good news!

I have a question regarding the client download available on this page:


I was wondering why the download link takes you to the client version 17.3.6943.0625, when according to the table on the same page it doesn't coincide with the Windows Insider, Production or Enteprise rings? It's somewhere between Production and Enterprise as far as I can tell (sorry, I'm off on a tangent here). The reason I ask is that I'd like to download it and force the deployed Office ProPlus machines to the latest version using a local file, instead of them automatically updating from the Internet as soon as an account is configured in OneDrive.

We rely on our auto-updater to ensure users get the latest release. Given you have a need for the standalone installer with the latest version, I've sent you a direct download link as a direct message.


Thanks a lot Ronak. Is this version supported for production use?



I'm happy to test this once it's released :)

Yes. That is the production version that clients will currently auto-update to once a user has configured OneDrive. 




Hi Adam!

You can test this today. The latest version of OneDrive has the ADM updates and any current clients will update to the latest version (unless you're on a deferred enterprise update).


Thanks for the information.

I am testing as we speak; the link downloads the onedrivesetup file, how can I access the updated GPO files?




The ADM files will be located in your %localappdata%/Microsoft/OneDrive/<build version>/adm directory. You can navigate to %localappdata%/Microsoft/OneDrive which will have the build version folders that contain corresponding ADM packages.