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?


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 ? Commented Feb 17, 2020 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
    Commented Feb 17, 2020 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/… Commented Feb 17, 2020 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
    Commented Feb 17, 2020 at 14:08
  • 1
    it clearly says that you donot have access to the folder, which you trying to create the network drive. Commented Feb 18, 2020 at 4:28

1 Answer 1


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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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