Thursday, March 29, 2012

Options to export sharepoint 2010 files to file share

I was recently working on a project requirement to download all the content of a document library to a file share. Those files then will be resembled, watermarked, and uploaded to another release control system.

Here are the detailed requirements.
  • Only current version of documents need to be downloaded
  • There are more than 5000 documents need to be downloaded and list throttling is 2000
  • Document types could be any type
  • Documents need to be downloaded into one flat folder

Since this is just one time request, by looking at different options, we plan to use the simplest method. Here are the options you may try form your end.
1. UNC mapping to the SharePoint document library and drag/drop documents to a file share. You could refer this blog for details. This is simplest way but it will not display files that exceed the list throttling. You have to connect to different views.

2. SharePoint explore view that is same as UNC mapping. Please note this is just available to the document lists. 
  • In any Documents, from the Actions menu, click Open with Windows Explorer.
  • In Windows Explorer, select the documents you want to export.
  • Under File and Folder Tasks, click Copy to.
  • In the Copy To window that Popups, select a target folder out of moss, then click the Copy button.

3. Powershell to download files. This case, you have to be on the SharePoint server to do this that is the major limitation.

4. Programmaticallythrough API.  Same as Powershell, you have to be on the SharePoint server to do this unless you change to use SharePoint client object model. You could overwrite the list throttling setting in the code. There are several APIs you could use.
5. Third part tools such as Bamboo bulk export or CodePlex tool. Bamboo toll is not free and we do not have good experience on their products. CodePlex tool is based on version 2007 and you may not use it for 2010.

6. Perl to SharePoint through web service. In our company, we have provided the custom web service to upload or download files from any library. We could use Perl to download the files to a file share.

Based on your requirement, you could select any method. Keep in mind that you may run into list throttling issue. One suggestion is if this is one time action, you might just increase the list throttling temporally during the execution time. Then revert back the list throttling setting after it is done. 

Wednesday, March 28, 2012

How to resolve files in SharePoint been destroyed from MAC WebDav?

SharePoint uses WebDAV as a foundational technology.  MacOS has a WebDAV client built-in.  Sounds like a good thing you could integrate SharePoint through WebDAV on MacOS , right?  Wrong. There is a critical issue that files will be destroyed if drag/drop from MacOS with built-in WebDAV client to SharePoint!

Here are the steps to reproduce this issue.
  1. Upload one file named TestText.txt to SharePoint library through browser
  2. Setup WebDAV from MacOS computer. Check here for detailed procedure.
  3. Drag and drop the file TestText.txt to SharePoint through WebDAV
  4. The file TestText.txt size will become ZERO – content destroyed as shown in the screen shot!

In our company, even MAC is not supported by IT, many people are still using MAC and connect to SharePoint through WebDAV. We have to find workarounds and solution.

Here are some workarounds.

The best solution to this problem we know of is the Microsoft Document Connection utility that is in Office for Mac 2008 R2 or 2011, Mac users can get a solution similar to WebDav that will support Basic Authentication.

To configure Microsoft Document Connection to work with SharePoint Online as part of the Microsoft Online service, follow these steps:
  • Make sure that Office 2008 for Mac is upgraded to Office 2008 for Mac SP2 or Office 2011. To do this, use Microsoft AutoUpdate.
  • Start Microsoft Document Connection. To do this, in Finder, under Applications, and then click Office 2008.
  • On the menu bar, click Document Connection, and then click Preferences.
  • In the Preferences window, make sure that the Enable Basic Authentication check box is selected.
  • Close the Preferences window. In the main window, click Add Location, and then click Connect to a SharePoint Site.
  • In the Site Address box, enter the main site collection address for the SharePoint site (including the http://).
  • Authentication should be set to Username and password.
    Click the Connect button.
    You should now have access to the documents in the SharePoint site collection.
    For more information, visit the following Microsoft Web site:

The other is Transmit, from a company called Panic. Transmit will allow for bulk download/upload whereas the Microsoft Document Connector is for working with a single document.

You If folks don’t have Office for Mac there is another utility suggested by users on the Apple support sites called muCommande. Another is Cyberduck is a utility available from the Mac app store

After we provided the workarounds to users, we received strong message from them. 
Below is some of the feedback for these workarounds.

1 –We can tell our Mac users to use the utility Microsoft provides, but there is no guarantee that they will and no safeguard in case they don’t
2 – This is not an acceptable workaround, as the consequence of not using the utility completely destroys the file in SharePoint along with all of its revisions. The workaround is unacceptable; as we can’t be sure our Mac users will not at some point forget to use the utility. This becomes especially important if we open up parts of our document repository internally to the company.
3 – About half of our team uses Macs. I’m not sure about the rest of the company, but a good portion of the folks that will have access to our site are Mac users.
Do you believe our Microsoft contact understands the integrity issue? Do they understand that using a common Mac OS X workflow, SharePoint documents can be obliterated? If their intent is to have SharePoint provide a robust, fault-tolerant document storage system that guarantees file integrity, they’re answer can’t simply be “don’t do that”.

As a result, we are continue researching the final solutions to block Mac WebDav calls. There are two layers (load balance or IIS) we could implement block these calls. My college Martin Bogan worked with our load balance NetScaler team and identify the way to block the calls.

Here is the solution to block Mac WebDav calls from NetScaler load balance.

The policy on the NetScaler is filtering on any HTTP headers that have both WebDAVFS and Darwin and will DROP based on that criteria.


This seems like to block all Mac WebDav calls without impacting other SharePoint functions. We are in the process to work with Microsoft to verify any potential impact.

Great thanks to Martin Bogan, several business analysts, and network team to provide the solution.