I have a number of pdf-reports that I would like to upload to a WSS 3.0 document library. The pdf-files are generated by a number of scripts that collect data and compile a report using LaTeX.

I can copy the pdf-files to the SharePoint document library by mapping the document library and using copy

net use x: \\path\to\sharepoint\document\library
copy myfile.pdf x:

where x: is a free drive letter. However, I would like to supply some additional metadata to columns in the document library directly from the script that generate the pdf-file and copies it to the SharePoint document library.

Is it possible to achieve the above using standard Windows command line tools or does a small application exist that I can put on the file server together with the report generating scripts? I don't have rights to install programs on the users PCs.

  • I think my question is a dublicate of this one: <sharepoint.stackexchange.com/questions/17074/…>. Sorry. Aug 1, 2011 at 11:28
  • Except for the metadata part. Aug 1, 2011 at 13:40
  • I really need some help here I'm in the same situation but I have a document I would like to change the Modified Date on. I'm struggling to do this with Powershell can someone help we are using Windows Sharepoint Servies 3.0 [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint") $site = New-Object Microsoft.SharePoint.SPSite(“upnorthsharepoint/UNGIMS”) $farm = [Microsoft.SharePoint.Administration.SPFarm]::Local $url = "upnorthsharepoint/UNGIMS" $listName = "Shared Documents" $item = $list.Items | ? {$_.Name -eq $fileName} $fileName = "Bring Your Own Device [BYO Apr 26, 2018 at 15:19

2 Answers 2


MS has a few posts that might assist you.

Uploading documents via the File Classification Service http://blogs.technet.com/b/filecab/archive/2009/12/14/automatically-upload-files-from-file-server-to-sharepoint-using-the-file-classification-infrastructure-fci.aspx

Managing doc libraries with PowerShell http://blogs.technet.com/b/heyscriptingguy/archive/2010/09/23/use-powershell-cmdlets-to-manage-sharepoint-document-libraries.aspx

Pingar, has created an API to work with documents and a script to use with it. I have not looked at it, but it appears to do what you want. http://www.pingar.com/Blog/Posts.aspx?PostID=55

  • Thanks. The PowerShell interface appeals to me. However, I'm not sure I can use it as a normal user with WSS 3.0? I have downloaded and installed PowerShell v2.0 from support.microsoft.com/kb/968929. This site get-spscripts.com/2011/03/… indicates that I should be able to use the SharePoint cmdlets with WSS 3.0 after issuing the command [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint"). However, this does not seem to activate the SP cmdlets? Aug 1, 2011 at 14:03
  • local use of powershell wouldn't be an option, as you need to have the sharepoint assemblies locally installed.
    – Bas Lijten
    Aug 1, 2011 at 14:20
  • There are no cmdlets for WSS3/MOSS. Basicly what you are doing is "hooking" into the object model. However the automation guru Gary Lapointe has created custom cmdlets for working with SP as well as extended stsadm commands (which you can script into Powershell for automation purposes): blog.falchionconsulting.com/index.php/category/stsadm-commands/… -- and yes they have to be executed on the server. Aug 1, 2011 at 14:22
  • Thank you Bas Lijten and Jesus Shelby. It seems that what I want is not possible for non-administrative users. The users that generate the pdf-reports do not have rights to access the stsadm command or to the Microsoft.SharePoint.dll on the server. They can add/remove files from the command line by mapping the document library or add/remove files and change metadata through the Web interface. Aug 1, 2011 at 14:44

Adding metadata won't be possible with PDF-files using the command-line. You will need to access the webservice to upload the document and provide the metadata. You can create a commandline application that calls the webservice to upload documents and add metadata to the files, when your script executes.

  • Do you have a link to an example of how to do this? Googling for command line and WSS gives me lots of information about administrating a SharePoint site using command line tools. But I can't seem to find information about adding or modifying contents as a normal user. Aug 1, 2011 at 11:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.