1

Using PowerShell and CSOM, I'm able to upload to the Drop Off Library but the document never route. Working with SP2016 on-prem.

  • Manually uploaded documents route correctly.
  • CSOM uploaded documents will route only after I edit the properties and click save (no changes are made to the metadata).
  • My account is in the Records Center Web Service Submitters group along with Site Owners.

Example of the script I'm working with:

        $FileStream = New-Object IO.FileStream($File.FullName,[System.IO.FileMode]::Open)
        $FileCreationInfo = New-Object Microsoft.SharePoint.Client.FileCreationInformation
        $FileCreationInfo.Overwrite = $true
        $FileCreationInfo.ContentStream = $FileStream
        $FileCreationInfo.URL = $File
        $Upload = $List.RootFolder.Files.Add($FileCreationInfo)

        $item = $Upload.ListItemAllFields
        $item["Router"] = "B" 
        $item.Update()
        $RemoteContext.Load($Upload)
        $RemoteContext.Load($item)
        $RemoteContext.ExecuteQuery() 
  • 1
    Shot in the dark - is it going in as “checked out”? – mannaggia Apr 22 '18 at 22:12
  • Require checkout is disabled. – Taco_Buffet Apr 23 '18 at 1:22
  • Yes but I’ve had files go in as checked out even when it is not required, especially if there is a required column. – mannaggia Apr 23 '18 at 3:38
  • Previously tried that with no luck. Error: "The file "DropOffLibrary/testUpload_0.txt" is not checked out." – Taco_Buffet Apr 23 '18 at 15:48
  • 2
    Any mandatory fields missing? I know you said you changed nothing but checking anyway... – Heiko Hatzfeld_MSFT May 2 '18 at 10:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.