title: Jenkins Publishing to SharePoint
body: <p>I'm working on a small project that requires the copying of a git repository of markdown files to a SharePoint directory. I'm using Jenkins for the project and now I've run into issues.</p>
  
  <p>I'm new to Jenkins but I found ArtifactDeployer's post-build action and it appeared at first to be the solution. Everything works up until the point where ArtifactDeployer attempts to move the files. Here's the output:</p>
  
  <p><code>[ArtifactDeployer] - Starting deployment from the post-action ...
  [ArtifactDeployer] - [ERROR] - Failed to deploy. Can't create the directory 'https://place.net/sites/05555/otherPlace/Big Project/Development/Markdown'
  [ArtifactDeployer] - [ERROR] - Failed to mkdirs: https://place.net/sites/05555/otherPlace/Big Project/Development/Markdown
  Build step '[ArtifactDeployer] - Deploy the artifacts from build workspace to remote locations' changed build result to FAILURE
  Build step '[ArtifactDeployer] - Deploy the artifacts from build workspace to remote locations' marked build as failure
  Finished: FAILURE
  </code></p>
  
  <p>At this point I'm thinking that ArtifactDeployer may not be the actual solution. The errors are not particularly illuminating but my guess is that it's not compatible with HTTP. The directory provided already exists, so there's no actual creation required.</p>
  
  <p>Now I'm looking at alternative solutions. I'm considering emailing the files to SharePoint. Perhaps using FTP-Publisher plugin for Jenkins would work. I just want to wrap this up.</p>
  
  <p>Any help or guidance would be much appreciated. Thanks.</p>
  
  <p><strong>Edit:</strong> In reviewing the email option, you can email files to the document library. There's even an option to group files into a file by the subject of the email. My testing shows that you cannot store the files two levels deep, only one. Of course my destination folder is two deep. This doesn't work for us.</p>
  
  <p>New possible solution I'm looking into is mapping the address to a drive in a batch file, moving files with ArtifactDeployer, and removing the mapped drive in another, final batch file.</p>
  
  <p>The newest issue is:</p>
  
  <p><code>System error 1244 has occurred.
  The operation being requested was not performed because the user has not been authenticated.
  </code></p>
  
  <p>The Jenkins user has admin rights to the SharePoint document library, it's unclear why this is happening.</p>
  
  <p><strong>Resolution:</strong></p>
  
  <p>I have it working now. Thanks in part to the one answer I received and some tinkering. I can confirm that your Jenkins user needs to have the proper rights level in SharePoint to complete this task. It now works with ArtifactDeployer. Here's what the meat of the Jenkins setup looks like:</p>
  
  <p>Execute Windows batch command:</p>
  
  <p><code>net use D: "https://place.net/sites/05555/otherPlace/Big Project/Development/Markdown" password123 /User:%USERNAME%
  D:
  </code></p>
  
  <p>...ArtifactDeployer does its thing...</p>
  
  <p>Execute Windows batch command:</p>
  
  <p><code>net use D: /D
  </code></p>
  
  <p>It works!</p>
  
  <p><a href="http://i.stack.imgur.com/vQRRt.png" rel="nofollow">Snapshot of Jenkins Solution</a></p>