Here in this post we will discuss how we can upload bulk documents to SharePoint 2016 document library using PowerShell. The same PowerShell script also works fine in SharePoint 2013 also.
Here we will upload documents to default “Documents” document library which is there in SharePoint 2016. I have a folder in my local drive which contains few files. We will upload those files to SharePoint 2016 document library by using PowerShell.
Below is the PowerShell script which you can run in PowerShell ISE.
function UploadDocuments($destination, $File)
$securePassword=ConvertTo-SecureString “Qwe@12345” -AsPlainText -Force
$credentials = New-Object System.Management.Automation.PSCredential(“MYSP\Administrator”,$securePassword)
foreach($fileName in Get-ChildItem $fileDirectory)
UploadDocuments -destination $destination -File $fileName
Write-Output “Upload file ” $fileName
Write-Host “Documents uploaded successfully”
Once you run the script, you will see files will be uploaded to document library like below:
Hope this article will help you to upload documents to SharePoint 2016/2013 document library.