0

I want to create a solution where documents from document library will sync automatically to local folder. Sync is not only for download at the same time whatever changes made to synced document should upload back to SharePoint. I found few articles but those are talking about how to download them only.

Is there anyway that I can achieve this through PowerShell or may be with onedrive API if available?

https://powershell.org/forums/topic/backup-sp-online-document-library-locally/
https://www.c-sharpcorner.com/blogs/get-all-documents-from-a-sharepoint-document-library-to-a-local-folder-using-powershell

Error while trying to add as network drive enter image description here

  • why not adding your document library as a new network drive in your system and access the files ? – Karthik Jaganathan Feb 17 at 13:10
  • Yeah that will work for one user. But we are in the process of migration. So 100s of users it should work seemlessly. So we need to identify automated way – Mihir Feb 17 at 13:13
  • What about creating a batch file, which will create network drive in our machine, so if we circulate the batch file to the users, then for everyone, it will create a network drive which maps to the SharePoint library community.spiceworks.com/how_to/… – Karthik Jaganathan Feb 17 at 13:35
  • I have tried to add SharePoint document library as network drive manually, but it is not working. It is throwing error – Mihir Feb 17 at 14:08
  • 1
    it clearly says that you donot have access to the folder, which you trying to create the network drive. – Karthik Jaganathan Feb 18 at 4:28
0

I am able to achieve this by running following script in PowerShell

start "odopen://sync/?siteId=SiteID_HERE&webId=WebID_HERE&listId=ListID_HERE&userEmail=UserEmail_HERE&webUrl=WebURL_HERE"

Earlier i was confused where to execute this by seeing start command. Later I understand that is part of PowerShell commands. One thing we need to do is based on site url, document name we need to get the ids using CSOM then execute above command. That will do the job with no issues.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.