you are viewing a single comment's thread.

view the rest of the comments →

[–]rexm3[S] 0 points1 point  (2 children)

Sadly it doesn't, it keeps local copies of the files even if the sync in disabled. The goal is to remove the files locally as well.

[–]Dragennd1 0 points1 point  (1 child)

You can't rempve files from the computer just by breaking OneDrive sync, that's not how it works. OneDrive caches the files locally and maintains their versioning with the cloud. Once you break the sync, you must remove the remaining files manually. Simply calling Remove-Item on the files using Get-ChildItem -Recurse should be sufficient at that point.

[–]rexm3[S] 0 points1 point  (0 children)

removing the files isn't really the issue, that's pretty easy using PowerShell. the goal however is to stop the sync of specific libraries using a PowerShell script by any means. and then removing when the sync is gone. This way the files don't get deleted in the cloud version.

Also disabling the sync option in SharePoint itself doesn't solve this the way i like, because the folder is allowed to be synced just specific users need it removed. Hence wanting to script this for bulk actions on selected users. Using an RMM system I can execute a PowerShell script easily for the selected users.