SPSync is now open source!

I know a lot of you have been waiting for it. I have decided to publish it as open source, because the tool has so much potential, but I have no time to work on it.

You can find it here on GitHub: https://github.com/mwiedemeyer/SPSync

Hopefully you do some cool stuff with it.

Note: I will not answer support questions via mail anymore. If you found a bug, please fix it on your own or file an issue on GitHub.

SharePoint changes files during CU installation

You might think, I’m drunk, but I’m not.

SharePoint, as a document management system, should never ever modify files without any notice. However, it seems that we found a bug, where it does modify files.


We have a lot of CSS files in SharePoint. They are used for some custom apps in SharePoint or were just uploaded to OneDrive for Business. All in a SharePoint 2013 OnPrem environment. The CSS files contain base64 encoded data URIs.


.myClass {
    background-image: url(‘data:image/png;base64,MY_IMAGE_AS_A_BASE64_ENCODED_STRING’) !important;

Then we installed a Cumulative Update and ran PSCONFIG.

And then?

What happened then is a really strange thing. The CSS files seem to be the same as before. The “Last Modified” date has not changed. However the content of the CSS file changed a little bit:

.myClass {
    background-image: url(‘data:image/png;base64,MY_IMAGE_AS_A_…_HERE_NOW_SOME_OTHER_STRING’) !important;

The base64 string before was about 600 characters. After installing the CU it is now 234 characters and only the first about 100 are the same. The rest is some garbage. That leads to broken images and icon-fonts all over the place.
The worst thing here is: What else did the CU installation?
We reproduced the behavior with 2 different CU installations on different sites and it seems, that only the base64 string is modified. Everything else is untouched.

We’ve filed a case at Microsoft and I will update the post when we will have an official statement.

SharePoint 2013: Profile synchronization does not delete user profiles

We have configured AD Import in SharePoint 2013 with an LDAP filter set. After some time we discovered, that accounts deleted from AD are not automatically deleted from SharePoint.

After a lot of debugging and testing I found the solution:

The LDAP filter is an "Include" filter so you have to define which accounts should be imported. The filter looked like:

(&(objectCategory=person)(objectClass=user)(!(title=*Service Account*))(|(company=MyCompany1)(company=MyCompany2)))

(Import all accounts which are not service accounts and belong to MyCompany1 or MyCompany2)

You see the issue? Deleted accounts are not included in the filter, so I had to change the filter to include "isDeleted":

(|(isDeleted=TRUE)(&(objectCategory=person)(objectClass=user)(!(title=*Service Account*))(|(company=MyCompany1)(company=MyCompany2))))

Now also deleted accounts are included and SharePoint will delete the profiles correctly.

Maybe Microsoft should mention this in the documentation. Currently there is only one sentence regarding the LDAP filter:

If you want to filter the objects that you import from the directory service, in the Filter in LDAP syntax for Active Directory Import box, type a standard LDAP query expression to define the filter.
Source: https://technet.microsoft.com/en-us/library/jj219646.aspx

SPSync 0.9.8

Ok, here we go. The sync engine got a major refactoring. It is now a lot faster to get the changes from SharePoint and to iterate over the local files. That means it is now just a matter of seconds to “analyze” the changes even for more than 1000 files and 1 GB. It should therefore also be able to sync your libraries with thousands of files in a reasonable time.

The other big news is the complete new setup experience. Just click here to download and execute the setup. It takes just a few seconds and SPSync should start. That’s it. No “Next”, “Next”, “Finish”, nearly no time and no local admin rights required. Even better: Updates gets automatically installed in the background and on next restart of the app you are up-to-date.

Please report all bugs to support@spsync.net

SPSync 0.9.7 including CLI

SPSync is approaching version 1.0. Today I’m happy to announce that SPSync now works more stable and also includes a new command-line interface.

It should work now with all SharePoint 2013 on-prem and Office 365 sites without any issues during connecting or displaying the “select folder” dialog. As the “SharePoint Url” you can now use more formats and SPSync will try to figure out the site, the library and the authentication method automatically. For example, these formats are all fine:

  • https://YourOnPremisesSharePointOrYourOnlineTenant.com/sites/teamsite1/_layouts/15/start.aspx#/Documents/Forms/AllItems.aspx
  • https://YourOnPremisesSharePointOrYourOnlineTenant.com/sites/teamsite1/Documents/Forms/AllItems.aspx

The most requested new feature is the command-line interface. You can find SPSyncCli.exe in the install folder.
It accepts two parameters. The local folder and a “preview” mode parameter.

You have to configure a sync connection like before with the GUI. After that, you can sync a folder with the following command:

SPSyncCli.exe “C:\Your\Sync\Folder”

If you just want to see, which files will be modified (but don’t want to do it now) you can sync in a “what if” or “preview” mode:

SPSyncCli.exe “C:\Your\Sync\Folder” true

The result looks like this:


SPSync now uses a different location for the metadata. It is now directly within the local folder under “\.spsync”. Therefore you might get a conflict message the first time you sync with the new version.

Download the new version here: http://spsync.net

Selective folder sync for SPSync

I’m happy to announce that the top requested feature on UserVoice is now available for testing.

Now you can select which folders in your document library you want to sync. Just click “Edit” on your configuration and then “Save & Select Folders”:

image image

Download version 0.9.6 here: http://spsync.net

SPSync - The OneDrive for Business alternative

I know, the last update is almost a year old... But yes, I’m trying to work on it when I find some free time. So this update brings some important changes.

What's new?

First of all, to add a new sync configuration, the dialog has only a few fields left. SPSync will try to find every other setting automatically for you. Here is the new dialog:


As you can see, the advanced configuration dialog can be opened via the link. The automatic detection will only work if you are using NTLM/Basic (On-Premises) authentication or Office 365. For ADFS you need to enter some more info on the advanced dialog.

Another new feature is that you can now configure, whether you want to sync in both directions or only one of them (Local->Remote or Remote->Local) which was a suggestion on UserVoice with a high vote. Also deleted files (local or remote) are now always send to the recycle bin and never get automatically deleted for ever.

With this new version I’ve decided to drop the support for SharePoint 2010 (and before), because of some missing features for the upload/download handling. This is to make the development much easier and better to maintain. That’s also why SPSync requires now .NET 4.5.1.

Last but not least, a lot of bugs are now hopefully fixed. If you find something, please send me an error report and attach the DebugLog.txt from C:\Users\%username%\AppData\Local\SPSync

Download the new version 0.9.5 here: http://spsync.net and leave a comment or drop me a line at: support (at) spsync(dot) net

PS: The next new feature will be to be able to sync sub-folders within a document library as it has already 20 votes on UserVoice.

SharePoint 2013: Timeout on ClientContext.ExecuteQuery

Ok, this one is a strange issue.

I have created a console app with Visual Studio 2013. Added the "App for SharePoint Web Toolkit" NuGet package to get the SharePoint.Client.dll
Then wrote just a few lines to test if it works:

        static void Main(string[] args)
            ClientContext context = new ClientContext("https://sharepoint/sites/test1");
            var web = context.Web;
            Console.WriteLine("Title: " + web.Title);

This is against an on premises installation with Kerberos authentication (NTLM and Basic are also enabled). On the line context.ExeucteQuery(); it just waits a long time and then gives me a timeout and 400 error.

The weird thing: If Fiddler is open during the execution, everything works as expected. No timeout, no error.


The solution is fairly simple:

Just attach a handler to the ExecutingWebRequest event and set the WebRequest.PreAuthenticate to true:

        static void Main(string[] args)
            ClientContext context = new ClientContext("https://sharepoint/sites/test1");
            context.ExecutingWebRequest += context_ExecutingWebRequest;
            var web = context.Web;
            Console.WriteLine("Title: " + web.Title);

        static void context_ExecutingWebRequest(object sender, WebRequestEventArgs e)
            e.WebRequestExecutor.WebRequest.PreAuthenticate = true;

Visual Studio Extension: SPDeployer

With SharePoint 2013 you can create great solutions not only with a "SharePoint Hosted-App", but with a plain JavaScript file within a Content Editor Web Part. Vesa Juvonen named it app script part pattern.

So development today is like:

  • Open the style library in Explorer and open the javascript file with your favorite editor. Not ideal, because you are not working within a solution in Visual Studio, so no source control integration, etc.
  • Use SharePoint Designer to work with the files –> Not a development environment you want to work with


Here comes my Visual Studio extension to the rescue. Install it directly from within Visual Studio->Tools->Extensions and Update. Search for SPDeployer or download directly from the Visual Studio gallery.

Open a solution with your web project, then click Tools->"Add SPDeployer to project". This will add a new spdeployer.config file to the currently selected project.


Just enter the details to you SharePoint dev site and add a line for each file you want to have SPDeployer automatically upload on save.

Now whenever you make changes in one of the monitored files, it will automatically upload to your SharePoint library.

You can find the sources on GitHub. Feel free to add issues or pull requests.

Simple SharePoint Forms Solution

You knew InfoPath? It's dead. So what is your current solution to just create a small/simple form in SharePoint to let users enter some information into a SharePoint list?

The default list forms are not a very good answer if it should be end user friendly or you want to style it.

So I've created a super simple solution and it is open source.

Just create an HTML form with your favorite editor and attach some special "data-" attributes, add a line of JavaScript and put everything into a Content Editor Web Part on your page.

You can find a complete guide at the GitHub project site.