How to Stop OneDrive from Syncing Specific SharePoint Libraries?

0
32
Asked By CuriousCoder42 On

I'm on the hunt for a way to customize a script that will stop OneDrive from syncing specific SharePoint sites or libraries. Once I've halted the sync, I'd like the script to also remove any local files that were left over from that specific site. If someone has a pre-existing script for this or can offer advice, that would be awesome! I'd like the flexibility to hard code the specific libraries to un-sync, as I may need to run this script using RMM software.

4 Answers

Answered By AutomationNinja On

I don't think there are any automation interfaces for the OneDrive desktop app aside from the odopen links that help add syncs. You might want to check the local appdata for any databases storing the sync status of libraries. But be cautious; messing with internal structures could cause instability in the app.

Answered By SharePointWiz On

You can configure a SharePoint library to make the SYNC option unavailable. However, if someone is already syncing it, changing the library setting might not remove the files from their PCs.

LocalFilesExpert -

Unfortunately, that doesn't resolve the issue. Even if sync is disabled, the local copies of the files remain on the machine. The ultimate goal is to clean those up as well.

Answered By LegacyScripter On

I remember that the command line options used to be listed on Microsoft Learn, but I can't track them down now. There's an older PowerShell module that was created, although it hasn't been updated in a while. It might give you some useful ideas: https://www.powershellgallery.com/packages/Onedrive-client/0.2.2/Content/Onedrive-client.psm1

Answered By TechGuru91 On

One approach could be to locate the related registry keys for the synced libraries and then remove those specific keys. I'm not sure if this will completely break the sync process, but it might be worth a shot!

CodeMaster007 -

Disabling sync using the registry might work. I'm a bit concerned it could leave files in sync limbo though, which might make it hard to remove them later. Still, I'll give it a try!

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.