Thursday, January 30, 2014

Keeping versions when upgrading documents from doc to docx in SharePoint

Today I got a support questions about why all the versions had been restarted on some documents in a library. It’s a QMS system, and keeping the version history is quite important for tracking.

The reason was that all the .doc files had been resaved as .docx, and then the old .doc files had been archived. This of course also messed up the unique document id’s by the document id provider, as new files had been saved, getting new id’s

If you edit properties on a document in SharePoint, you notice there is no way change the file extension.


However, if you open the library in Windows Explorer (via the ribbon), you can easily rename files from .doc to .docx.

The procedure to keep the history and document id would be:

  1. Open the .doc file in Word
  2. Save as .docx locally on your machine
  3. Rename the .doc file in Explorer to .docx (the folder you opened from SharePoint)
  4. Copy the locally saved .docx over to the Explorer folder

Monday, January 27, 2014

Rank Model Tuning App for SharePoint available in the App Store

As I wrote earlier, the documentation on the App was released some weeks ago, and now the App is released itself.

Install it in your SPO tenant and play around with it (if you’re unhappy with the existing relevance or if you want to test it out).


I’ll test it out in the days to come and try to give a step-by-step review on how to use it. David Hollembaek and I will also demonstrate how to use it at SPC in “Managing Search Relevance in SharePoint 2013”.

Wednesday, January 22, 2014

How to add more than 20 refiners to a search page in SharePoint 2013/SPO

Note: Adding more than 10 refiners may impact search performance

Matthew McDermott recently asked if the limitation for 20 refiner categories is a boundary or if it can be changed.


Using the refiner configuration on a search page as seen above you see that you cannot add more than 20 refiners using this dialog. There are at least three ways in which you can overcome this.

Option #1

Open up dev tools in your favorite browser and remove the “disabled” attribute of the Add button. Below is the same image as above, but with the button enabled.


Option #2

Export the refinement web part, open it up in your favorite editor and manually edit the SelectedRefinementControlsJson property, then import the web part back into the page.


Option #3

Use PowerShell or code to check out the page, get the web part and modify the property in option 2. Much like my post on turning off duplicate trimming.

Monday, January 13, 2014

Using Excel Surveys in SharePoint 2013 on-premises

[Update 3 - September 22nd 2015]
Thanks to Brandon Showers who let me know this was no longer working, so I tested it now with the August 2015 CU, and Microsoft has added some checks. Basically you need to ensure two farm elvel properties are set to true before you can set the ShareByEmailEnabled property on the site collection to true. So here goes:

$farm = get-spfarm
$farm.Properties["GuestSharingEnabled"] = $true
$farm.Properties["SPO-GuestSharingUIEnabled"] = $true

As you can see, we now need to set an SPO specific property as well to get this working. Once you have the farm level properties in place you can enable ShareByEmailEnabled on any site collection.

[Update 2]

Seems there is an even easier way of doing this. First create a new Excel document in your SkyDrive library, then look at the ribbon in Excel Web Apps and click the “Survey” button.


The next question is why this option is available on SkyDrive Pro and not for example a Team Site? Enlisting the help from Wictor Wilén solved it fairly quick. If you set the property ShareByLinkEnabled on SPSite to true, the survey option becomes available. This option controls if a user will be able to share links to documents that can be accessed without logging in.

[Update 1]

Using Fiddler I found out that the link to create a new survey look something like this:

where TemplateType is the clue to create a survey. TemplateType=2 is a regular Excel sheet and 5 is survey. With this information it should be fairly easy to create a custom action which will let you create a survey from a button or link.

[Original Post]

SharePoint On-line has a cool function which allow you to create a new survey using Excel and Office Web Apps. If you head over to your SkyDrive (Pro) and click new document you are presented with the following dialog which allows you to create an Excel survey.


My next thought was that this would be a cool feature on-premises as well, but further examination show the link is not showing on SkyDrive for an on-premises installation of SharePoint 2013.
But, that does not mean that it’s not there :-)

First head over to SkyDrive on your on-premises farm. Next create a new document and pick Excel workbook. The URL will look something like this:


The clue now is to change the editnew action with formedit, 

This will bring up the Edit Survey dialog and you can create and share your survey.


I tried the same approach in a document library on a team site, but that did not work, so not sure which feature on SkyDrive (Pro) which enable the survey functionality.

You can read more about creating a survey at

Sunday, January 12, 2014

Sharing content with external users in SharePoint Online - What is needed?

Sharing content with external users is quite easy with SPO. It’s quite well documented at the Office website, but I thought I would break it down.

  • A sharing invite expires after 7 days
  • A sharing invite can only be used once, meaning it will expire after it’s first use so forwarding of the invite will not compromise anything
  • A shared site requires the external user to log in using either a Microsoft account (former Live Id) or a Microsoft Office 365 account
  • Documents may be shared anonymously, or require a Microsoft or Office 365 account


Friday, January 10, 2014

Setting up authorization with Office365 (WAAD) for an Azure Web Role

I’ve been working with porting an existing ASP.Net application over to an Azure Web Role. At the same time I wanted to look into setting up authorization against third party providers, in particular for Office 365 users.
Topics covered in this post:
  • Set up an Access Control Namespace (Access Control Service/ASC) in Azure
  • Configuring the ASC to use Windows Azure Active Directory (WAAD)
  • Configuring the WAAD to trust the ASC
  • Adding an identity provider to your web role
  • Configuring the ASC to trust the application
I’m not detailing all the background information for each step, but try to cover all the necessary steps to get it all up and running.