question

tarouchabi-7271 avatar image
0 Votes"
tarouchabi-7271 asked CiciWu2-MSFT commented

How to redirect local folder to onedrive

I want to redirect the user profile folder to the onedrive folder "hostname".
Please tell me the setting method. Is the setting location "Set the default location for the OneDrive folder"?
I set "" d3*--* "="% username% \ OneDrive --chabi \ SecurePC "" but I fail

105052-image.png

105091-image.png


mem-intune-generalwindows-group-policy
image.png (39.5 KiB)
image.png (67.7 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

RahulJindal-2267 avatar image
0 Votes"
RahulJindal-2267 answered RahulJindal-2267 commented

The name field will need to carry your tenant id and have you tried the value as %username% %computername% ?

· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Yes. I want to redirect to a specific folder in onedrive.
Well... When I set "d3 -" = "% username%", the folder will be redirected to "%username%\OneDrive--chabi".

But, I want to redirect ""%username%\OneDrive--chabi\NewFolder".
The truth is, I want to create a Newfolder dynamically. So,,, I want to automatically create a Newfolder with the name of computername.
Is it possible?

0 Votes 0 ·

Never tried this but you can try substituting New folder with %computername% to see if that works or not.

0 Votes 0 ·
CiciWu2-MSFT avatar image
0 Votes"
CiciWu2-MSFT answered CiciWu2-MSFT commented

There is a setting of setting the default location for the OneDrive folder. 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 is the path that you specify. To specify your tenant ID and the path, in the Options box, select Show.

This policy sets the following registry key to a string that specifies the file path:

[HKCU\SOFTWARE\Policies\Microsoft\OneDrive\DefaultRootDir] "1111-2222-3333-4444"="{User path}"

where "1111-2222-3333-4444" is the tenant ID.

If you disable this setting, the local OneDrive - {organization name} folder location defaults to %userprofile%.

Note that the %logonuser% environment variable won't work through Group Policy. We recommend you use %username% instead.

Reference: Set the default location for the OneDrive folder


· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

I have already seen this url. So, I set "tenat id"= "% username% \ OneDrive --chabi \ SecurePC ". But, I can't redirect the NewFolder "SecurePC" in OneDrive.
If you know, please tell me a concrete setting example.

And I have already seen "https://gitlab.com/Lieben/assortedFunctions/blob/master/Invoke-O4BAutoMount.ps1".
Can I currently redirect all folders in my user profile to onedrive with my intune settings?
Do I need to set it in a script?

0 Votes 0 ·

I tested in my environment but doesn’t take effect. To resolve this issue more effectively, it is better to contact Intune online support. Here is the link: https://docs.microsoft.com/en-us/mem/get-support


0 Votes 0 ·