Enumerate sync folder setting on OneDrive by scripting

mINI 6 Reputation points
2021-11-04T03:29:58.37+00:00

Hello, everyone

I am using Windows 10 Enterprise 1909 and OneDrive (for business version 21.205.1003.3)
I have enabled folder sync on OneDrive settings as attached screen shot.
I would like to stop sync for some of folders on this screen.
After configured setting. I would like to take backup of sync settings of folder selection.
Can I get sync configuration data by Scriptinig or other method ?

146404-screenshot-2021-11-04-111133.png

Windows 10
Windows 10
A Microsoft operating system that runs on personal computers and tablets.
10,611 questions
JavaScript API
JavaScript API
An Office service that supports add-ins to interact with objects in Office client applications.
866 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Limitless Technology 39,351 Reputation points
    2021-11-04T20:45:06.627+00:00

    Hello @mINI

    This is explained both with Administrative Templates method and Powershell methods here: https://techcommunity.microsoft.com/t5/microsoft-intune/configure-onedrive-for-business-to-sync-only-certain-folders-in/m-p/1139740

    Hope this helps with your query,

    ---------
    --If the reply is helpful, please Upvote and Accept as answer--

    0 comments No comments

  2. Alexandru Matei 1 Reputation point
    2022-02-02T10:04:06.3+00:00

    Hi @mINI

    I am also interested to use C# or Powershell to prevent/uncheck a certain OneDrive subfolder from being synced locally on my laptop

    https://support.microsoft.com/en-us/office/choose-which-onedrive-folders-to-sync-to-your-computer-98b8b011-8b94-419b-aa95-a14ff2415e85

    Can you provide a follow-up with more info about how to do that?

    0 comments No comments