Forum Discussion
ScottonTap
Jan 22, 2021Copper Contributor
OneDrive Sync/Stop Sync - delete local files
Looking for a solution User syncs SPOL library User stops Sync Local file/folder structure remains - Looking for ideas on script that can run and delete those local files/folder once status ...
markrwdn2245
Apr 30, 2021Copper Contributor
I have the same question ScottonTap does - how can we tell clients that our staff no longer have access to files if we cannot delete them from their machines after removing Sharepoint access?
The 'Sync' option should automatically be turned off after access is withdrawn, meaning we should then be able to run a powershell script to delete the local copy of the folder. Currently even if I click 'stop sync' on the folder I'm still met with Powershell telling me I can't delete the folder because 'Access to the cloud file is denied' if I run the below:
Remove-Item -Recurse -Force "local path name"