Forum Discussion
Uday Kiran Reddy
Dec 12, 2017Copper Contributor
How to uploads files to OneDrive for Business using Powershell
I tried the sample powershell code in below link, getting error as path not found.
https://community.spiceworks.com/topic/2001221-powershell-script-to-upload-file-to-onedrive-business
Sam...
Gerhard_Wessels
Jun 04, 2019Copper Contributor
Hello, I get the same error.
This worked 'previously' ( until about February this year ).
I am having the same issue with uploading to sharepoint teams sites.
I have tried every piece of code and uploader I could find in the last 2 weeks and nothing is working.
Flinx
Dec 18, 2019Copper Contributor
I had to modify this line to make it work
$FileCreationInfo.URL = $File
to this
$FileCreationInfo.URL = $ServerRelativeUrlOfRootFolder + "/" + $File.Name
This needs to be a web relative url and not the file path.
Its should equate to something like:
/personal/your_name_domain_com/Documents/Filename.txt
- Shintaro8088Jan 19, 2024Copper Contributor
How do I use your great code and make it so it that allow me to download users' onedrive for business data to my local drive?
Thanks