none
unable to bulk upload files to office 365 site RRS feed

  • Question

  • hi,

    i have downloaded the script from below link to bulk upload the documents. All my documents are available in a folder of my local system.

    https://gallery.technet.microsoft.com/PowerShell-Bulk-Upload-b9e9d600/view/Discussions#content.

    Microsoft.SharePoint.Client is required on my local machine  to execute the script ? Am getting below error while executing the script.  can you please suggest.

    Add-Type : Cannot bind argument to parameter 'Path' because it is null.

    At E:\BulkUploadSharePointCSOM\BulkUploadSharePointCSOM.ps1:26 char:15

    + Add-Type -Path <<<<  ([System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Client").location)

        + CategoryInfo          : InvalidData: (:) [Add-Type], ParameterBindingValidationException

        + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.AddTypeCommand

    Monday, January 9, 2017 10:45 AM

All replies

  • That script uses a combination of CSOM and PowerShell.  To do that you need access locally to SharePoint objects and namespaces.  The following article describes how to get hte .dlls you will need to run the code successfully.

    http://www.sharepointnutsandbolts.com/2013/12/Using-CSOM-in-PowerShell-scripts-with-Office365.html


    Paul Stork SharePoint Server MVP
    Principal Architect: Blue Chip Consulting Group
    Blog: http://dontpapanic.com/blog
    Twitter: Follow @pstork
    Please remember to mark your question as "answered" if this solves your problem.

    • Proposed as answer by Huzefa Mala Monday, January 9, 2017 12:12 PM
    Monday, January 9, 2017 12:04 PM
  • Thanks for the details provided.

    As per the given link i need to have dlls in my local system from "C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI " path of a sharepoint system.

    is there any place where i can download these dlls from internet ?

    Tuesday, January 10, 2017 7:03 AM
  • Hi Nikhil,

    We can download the SharePoint Online CSOM to local from Internet using Visual Studio Package Console Manager using the command:

    Install-Package Microsoft.SharePointOnline.CSOM

    It will download the latest version of SharePoint Online CSOM, then we can change the reference path to actual path in scripts to reference it.

    More information:

    Microsoft.SharePointOnline.CSOM 16.1.6008.1200

    Thanks

    Best Regards


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Tuesday, January 10, 2017 9:27 AM
  • Hi,

    Latest version of CSOM is available as Nuget package for developers, not sure if direct download locations are still maintained by Microsoft.

    Looking at what you are trying to do I would recommend the following project which I have used many times in the past;

    http://difs.codeplex.com

    If you install this you will have;

    1. The client DLLs you are missing.

    2. An example Powershell script showing you how to include these in Powershell (Installed to examples directory)

    3. A better and free tool / Powershell script for bulk import of documents (The documentation includes examples). 

    Tuesday, January 10, 2017 9:34 AM