Saturday 14 January 2017

Upload files to SharePoint from a Client Machine


Today I am providing the Power Shell Script that is useful to upload all the files from a given folder to a given library from a client machine. This script does not need any power shell management shell or power shell remoting.

Inputs-
Destination Library - Enter the web url of the library where you want to upload files.
File path - Path the folder where the files are kept for uploading. All files in this folder will be uploaded in SharePoint library.
Credentials - as we are connecting to SharePoint we will need to provide credentials to upload files to library. User should have Contribute access to library and Read access to site.

Outputs-
All the files of given folder will be uploaded in the given library.

Example-
.\scriptname.ps1
.\scriptname.ps1 | out-file “FilePath\Filename.txt”

Dependencies –
For executing this script user must have read access on the site and contribute access on the Library.

How to execute -
Copy this script and paste in Note pad.
Save this file as .ps1.
Run this script in Power shell from any client machine where SharePoint is accessible.
Follow on screen instructions.


FOR ANY HELP ON THIS SCRIPT USE "GET-HELP .\SCRIPTNAME.PS1 --FULL" AFTER SAVING THIS FILE.
https://drive.google.com/file/d/0BznVpoE_ln0AdFV0Y2kzLWt0c2s/view?usp=sharing

No comments:

Post a Comment