Sunday, December 25, 2016

Communication & Marketing with Planner - Office 365 Groups Scenarios (2/4)


Ever since Office 365 Groups was released in preview the discussion “when to use what” has been going on between Office 365 Groups and Team Sites. I’ve been opinionated in the debate myself, but instead of listing pro’s and con’s I presented four scenarios at Ignite in Atlanta where Office 365 Groups shows great promise of solving work related problems.

You can get the slides and watch the recording of my session BRK2277 - Learn about Office 365 Groups and how to use them, at the Microsoft Tech Community site. The video is also featured on Microsoft’s support article: Learn about Office 365 groups.

Communication & Marketing


This scenario is about marketing activities and is highly driven my tasks in Planner. Different tasks related to for example news articles, recruiting campaigns, and updating the public web sites are all added to Planner as a place to know what’s in the pipe. Events related to marketing efforts and various important deadlines are added to the Groups calendar. Files related to marketing collateral are stored in SharePoint, and notes on vendors and venues are stored in OneNote. We also receive Puzzlepart relevant tweets and news into the Groups mailbox using the Groups connectors.

Previously we had tasks in Jira, files in Dropbox, and no shared view of monitored news. Moving this to an Office 365 Groups has made a lot of sense in order to get a unified view of marketing and communications efforts.

Other planner based scenarios following the same lifecycle:

  • Development tasks in a kanban style manner
  • Todo lists for a larger group of people

Thursday, December 15, 2016

The Calendar - Office 365 Groups Scenarios (1/4)


Ever since Office 365 Groups was released in preview the discussion “when to use what” has been going on between Office 365 Groups and Team Sites. I’ve been opinionated in the debate myself, but instead of listing pro’s and con’s I presented four scenarios at Ignite in Atlanta where Office 365 Groups shows great promise of solving work related problems.

You can get the slides and watch the recording of my session BRK2277 - Learn about Office 365 Groups and how to use them, at the Microsoft Tech Community site. The video is also featured on Microsoft’s support article: Learn about Office 365 groups.

The Calendar


This scenario is focused around events in time, typically recurring events. The event at a point in time is in focus, and you use Office 365 Groups to support the event. The Group Calendar handles the scheduling of the event, conversations before and after the event can take place using the Group mailbox, and notes during the event are stored in the Groups OneNote. If you want to chat during the event, you could opt-in to use Microsoft Teams.

In my Ignite demo I showed Puzzlepart’s internal recurring event Puzzle Friday, where we every other month go over financial status, give an overview of customer cases, have topic discussions and I present “The Svenson Files”, an aggregate of what has happened in the Office 365 space since last meeting.


As you can see, we use OneNote both for the agenda and all notes taken during the event. We also add follow-up tasks in the OneNote itself. Supporting presentations are stored in the Groups document library, one folder per event occurrence. Then linked into the OneNote. The beauty of this is that we can have one pc hooked up to the projector, which always have all content needed easily available. No switching to my pc for some presentation – it’s all available :) For live demo’s we often create web casts up front, stored in Office Video.
Other calendar scenarios following the same lifecycle:
  • Board meetings
  • Any department/division regular meeting
  • Sprint planning / reviews
If you wanted to improve on the scenario you could build OneNote templates to cover all pages needed per event occurrence.

Wednesday, December 7, 2016

Tip for writing multiple XRANK’s or nested XRANK’s


My colleague Tarjei had a requirement to list items in a particular order on a page. The items were tagged with different phases and he wanted items to be listed in this order:

  • Concept
  • Planning
  • Doing
  • Finishing
  • Realization
  • No phase

The easiest approach I have found doing these types of custom ordering is using XRANK with bulk interval boosts to ensure the order. Pick an interval which suits you. If you need multiple levels of sorting add secondary sorts with intervals less than the major range.

One level sorting:

  • Concept cb=100
  • Planning cb=90
  • Doing cb=80
  • Finishing cb=70
  • Realization cb=60
  • No phase cb=50

Two level sorting:

  • Concept cb=1000
  • Planning cb=900
  • Doing cb=800
  • Finishing cb=700
  • Realization cb=600
  • No phase cb=500
  • Word cb=50
  • Excel cb=40
  • PDF cb=30

Once you have the logic in place you need to write a nested XRANK statement. This often gets confusing with getting parenthesis correct. A Pro tip is to use Freshness Boost Generator in the SharePoint Search Query Tool as a starting point, and then replace your matching and boost expressions as needed. Say you need 6 sorting intervals. Set the constant and max boost values to 0, and add 6 day intervals as seen in the image below. Copy the resulting expression and change the write>{} parts and XRANK(cb=) parts as needed – with all parenthesis intact at the right places.


Thursday, November 10, 2016

Two SharePoint Online search nuggets from Ignite

Ignite is long over, but there were two very useful nuggets in the session BRK2045 – Explore new personalized, intelligence powered search experiences in SharePoint, Delve and O365.

Disclaimer: We don’t know the exact timeline for these features, but they are on the roadmap.

Image result for nugget

  • Content enrichment web service will work for hybrid crawls – This allows you to keep any existing investment in CEWS to work if you switch to indexing content into the SPO index instead of your on-premises index (slide 25)
  • Custom synonyms feature in SPO admin UI – Perhaps a bit cryptic, but this means we will get a thesaurus in SPO search. Huge! (slide 26)

You can find the presentation and video of the session at the Microsoft Tech Community site.

Don’t be afraid of spaces in your query templates


I was talking to Andrew Clark and he was pretty frustrated after debugging a search issue. Turned out the query template was written like this:


Notice the lack of a space between {searchTerms} and path. So when adding query variables, throw in some spaces and you can cut a lot of frustration when debugging. If not the the last query term will have path appended to it as part of the term like: foopath: instead of foo path: 

The right syntax is:

{searchTerms} path:

Thursday, November 3, 2016

Whac-an-MVP - creating a PowerApp Game

PowerApps shows a lot of potential to enable power users to create line of business application for their organizations and teams. It’s cross platform, and I see a lot of good mobile use cases for form entry in the field, where data is then sent back to a central repository. The integration with Flow makes it quite powerful in terms of achieving business processes as well. I’ve dabbled a bit with iAuditor before, and I think PowerApps could solve many of the same cases.

Learning PowerApps


When teaching myself new technology I either need a concrete business case or something fun as the basis. Some people got a taste of that at Ignite ;-)

For PowerApps I started out with a proof-of-concept data entry app for a customer, but I cannot disclose details of it yet. In general it shows product information and allows you to visually configure product options and then send an order to a back-end system. In this instance a SharePoint list, but it could very well be some other ERP system.

Wednesday, November 2, 2016

Creating a resize animation in PowerApps

PowerApps made general availability November 1st 2016, and provides a great way for line of business specialists to create no-code applications to solve business challenges they see in their department or team. Once you tapped into data sources and created your logic, you might want to spruce up the application with some animations to make it look a little bit slicker. And that’s the basis of this post.

Read more about PowerApps at

I’ve recently been developing a couple of PowerApps, and in one of them I wanted to resize an image in a fluid manner before displaying an entry form. There are no built-in transition effects on objects, but by using the timer control you can actually achieve quite a lot.

Your other option is to create the animation somewhere else as either a movie file or gif animation, but where’s the fun in that.

Add an image control and timer control

Image controls can show images from either embedded resources, or from a web address. I’ll go with the latter. Add an image control to your screen and set the Image property to some URL.


Resize the image to the start position and add a timer control to the screen and set the Duration property of the control to 2 seconds (2000 milliseconds).

As I want the image to be half the original size, I’m using this formula:

768 - ((384*(Timer1.Value/Timer1.Duration)))

768 is the full height, and 384 is the half of that, so I replace 768 with the formula above, which will over the span of the timer reduce the height of the image down to 384.


Start a preview of the screen, click the timer control and watch the animation unfold.


You can of course hide the timer and start that by some other action, but it shows the concept and should get you started. If you want a slower or faster animation, just change the timer duration.

Tuesday, September 20, 2016

PowerShell script to upload user profile images to Office 365

There are numerous posts out there about how to do this, but thought I’d share my small script which includes the option to have images > 10kb. The script assumes you have a folder with with images on the notation <username>.jpg. It will loop over all images and use the Set-UserPhoto commandlet to upload the image.

The first time you run the script it prompts you for the password for the account you are using and stores it as a secure string in a file to be used on sub-sequent runs or on a schedule. The script will also move images one folder up after processing.

$adminUser = ""
$localFolderPath = "d:\images\upload" 
$passwordFile = "$PSScriptRoot\userphoto-password.txt"

    read-host -prompt "Type the password for $adminUser to be used (will be saved encrypted)" -assecurestring | convertfrom-securestring | out-file $passwordFile

$password = cat $passwordFile | convertto-securestring
$MSOLCred = new-object -typename System.Management.Automation.PSCredential `
         -argumentlist $adminUser, $password

$ExOLSession = New-PSSession -Credential $MSOLCred -authentication Basic -Configurationname Microsoft.Exchange -ConnectionURI -allowredirection

#load Exchange Online Management cmdlets
Import-PSSession $ExOLSession -AllowClobber

$files = ([System.IO.DirectoryInfo] (Get-Item $localFolderPath)).GetFiles() |  ForEach-Object {
    if(([IO.Path]::GetExtension($_.FullName)) -eq ".jpg") {    
        $username = [IO.Path]::GetFileNameWithoutExtension($_.FullName);    
        $userPhoto = ([Byte[]] $(Get-Content -Path $_.FullName -Encoding Byte -ReadCount 0))
        Set-UserPhoto -Identity $username -PictureData $userPhoto -Confirm:$False
        #move files one folder up after processing
        $destinationFolder = Split-Path -Parent $_.Directory.FullName
        move-item $_.FullName $destinationFolder
#unload session
Remove-PSSession $ExOLSession

Thursday, September 15, 2016

SharePoint Online Search Toolbox

Bilde av app
Finally! It’s taken me a while to get this app ready as I’ve developed it in spare evening hours here and there. But it’s out, and I hope it fills a need.

SharePoint Online Search Toolbox by Puzzlepart
Get the app!

Creating search based solutions and troubleshooting search in SharePoint Online takes time. Time and money more wisely spent on the actual solutions themselves. Over time I’ve discovered two major gaps when we moved from on-premises to online: Being able to run full crawl when we change the search schema and being able to investigate and look at the crawl log.

'SharePoint Online does not allow the same control as SharePoint 2013/2016, but there are ways. Previously I’ve created PowerShell scripts to trigger re-indexing of content and user profiles, and you can actually via e-Discovery get access to the SharePoint Online crawl log, but this also expose all your content – something you might not want to give out to anyone.

Hence, I started developing SharePoint Online Search Toolbox. The application gives you a UI to view the crawl log, much like you can on-premises, and it also allows you to trigger re-indexing of user profiles or content tenant wide. The app is distributed on subscription, per tenant but if you’re like me and my colleagues at Puzzlepart, you should quickly save this when a search issue arise.

If people value the application, and have suggestions for features, they might just be added :)

And.. if you’re a Puzzlepart Assist 365 customer, we’ll throw the app in for free!

App image

Friday, September 9, 2016

Why you should use tools like SPCAF when developing for the SharePoint framework

Just want to say that I’m not affiliated with Rencore in any way, and I write this review on my own merit – not being asked or forced to do so :-)

Being an Office Server and Services MVP I know most of the guys at Rencore, and have for a long time. As I’ve been part of the SharePoint Framework preview program at Microsoft, the guys at Rencore asked me if I wanted to test out a beta version of SPCAF for the SharePoint Framework. As I’ve just completed a SPFx web part for an Ignite showcase I figured I’d give it a shot.

I first had some issues with the SPCAF license they gave me, but that got fixed fairly quick. These guys know how to provide stellar support for sure.

So what happened when I ran gulp spcaf in my project?


4 critical errors, 6 errors and 1 warning

The critical ones were related to custom web part properties which I had forgotten to add to the web part manifest, and one which was in the manifest, but I wasn’t using. The warning was due to I had specified both to use a font based icon and an image based icon for the web part – left overs from testing (and a bug filed). All easily fixed as it pointed me to the file needed fixing.

The 6 errors were related to dependencies for Office UI Fabric components I had forgot to list in the external list. I did have the main component listed which was done automatically when I added the package, but the specific components I had not thought about (Button, List, Spinner etc). I knew the file for this was config.json in the config folder, but would be nice if the report stated so as well. Rencore, you fix? :-)

So, all in all.. config errors, none real critical, but nice to have fixed for sure. And I’ll definitely continue to use SPCAF for future SPFx projects. It takes over where the linting of TypeScript ends. I give it two thumbs up!

Thursday, September 8, 2016

Office 365 Groups , Delve Analytics and Search–I’ll be speaking at Microsoft Ignite 2016


A couple of more weeks now and Ignite kicks off! I had a blast last year and I’m looking forward to see how this years event turns out as well as looking forward to hang out with new and old friends in the SharePoint community.

Here’s the breakdown of the three sessions I will be delivering – and if you’re going maybe I’m covering a topic you’re interested in.

Be more effective with Delve and Office Graph Analytics

THR2191 – 20 minutes - Wednesday, September 28, 2016 5:05 PM - 5:25 PM – Expo Theatre 3

Are you curious about how Delve Analytics and the information in the Microsoft Office Graph can make you more effective? Get a quick demo of the insights available out of the box in the different Office 365 plans and you might just end up more self conscious about how and who you work with.

Move search from on-premises SharePoint to the cloud: tips and tricks

THR3055 – 20 minutes - Thursday, September 29, 2016 1:35 PM - 1:55 PM – Expo Theatre 4

Going cloud means you have to analyze your on-premises setup and see what works in the cloud. This session covers some of the bumps you might encounter and show possible alternative roads to make sure the journey is successful. We touch on both moving content and search to the cloud, and the new Cloud Search Service Application for hybrid scenarios.

Learn about Office 365 Groups and how to use them

BRK2277 – 45 minutes - Friday, September 30, 2016 9:15 AM - 10:00 AM – C114
(Originally labeled as a panel discussion – but it will be a demo session)

Microsoft Office 365 Groups uses the best of breed functionality of many Office 365 services like e-mail and calendars from Outlook, files and OneNote from SharePoint and tasks from Planner. You can also create pages and lists with the recently announced team site attached to the group.

With all this functionality, where should you start and how can Office 365 Groups help your business?

The session gives an overview of what Office 365 Groups are, and will cover use cases like event handling, marketing planning, educational use as well as social media handling, where Office 365 Groups can be a good fit for your organization.

Tuesday, August 30, 2016

Why you should use Azure AD id’s and not e-mail addresses or UPN when bulk importing user profile properties to SharePoint Online


Back in April Microsoft released details of a new API do do bulk import of user profile properties in SharePoint Online. Say you have a field with an employee id, and you want to set this for all users in your organization. As Azure AD does not allow you to map custom fields into the user profiles automatically you have to set the data your self. Previously you could use the user profile API as an admin to do this, but it was not possible if you were for example using an automated app with app tokens, and you also had to loop over all profiles, updating one at a time.

You can read more about the API and see a full code sample at

Tuesday, August 23, 2016

Custom hyperlink icon column using Flow

Laura Rogers (@wonderlaura) writes awesome end-user SharePoint posts, and recently wrote one which caught my eye – “Custom hyperlink icon column”. The write-up explains how you can add a custom column to a SharePoint list which shows an icon with the use of SharePoint workflows. This got me thinking if this is doable using Flow instead…. and it is :)

I suggest you read Laura’s post first, then go ahead with this one.


Note: This only works for SharePoint lists at the moment using Flow, not document libraries

For my scenario I will cover how to add a custom edit icon to a list – which in a modern list view takes you to edit mode in one click instead of two. Wooo!

Friday, August 19, 2016

Overriding default styles in a SharePoint Framework project


I’m building something using the pre-release of SPFx and by default when you start a project you have a SASS scss file for styles named something like MyPart.module.scss. This is all fine. Say you create a class:.myClass {}

This will be bundled and prefixed for you to be unique when you run the web part, like this: .myClass_e90cb14c

But what if you don’t want class names to be prefixed? In my case I needed to overload some styles coming from a component I’m not controlling. It’s actually very very very easy. I added a normal .css file to my project and at the top of the .cscc file I added the good ‘ol import statement like this:

@import url('MyPart.override.css');

The imported file will be included just fine, just not prefixed like the ones in the scss file.

(Thanks to the Kimzter for hinting I should try this)

Thursday, June 23, 2016

Introducing Microsoft Forms*

June 20th, 2016 Microsoft announced the preview of Microsoft Forms, a new formative assessment and survey tool in Office 365. The caveat is that it’s targeted to Educational licenses only. This means Enterprise customers can not use this at the moment, but as the announcement says, Microsoft is exploring the possibilities for it but with no time line.

You can find it at if you have an EDU license.

Let’s not dwell on license issue and see what Microsoft forms all about? The product today is an answer to educators to have a quizzing function inside of Office 365 – not a replacement for InfoPath if that is what you are looking for.

Wednesday, June 15, 2016

How to favorite a Groups calendar for easier access in the Outlook Windows client

Office 365 Groups comes with a real Exchange calendar, but accessing a Group calendar is a bit cumbersome via the Outlook 2016 client. You first have to expand the Groups listings in e-mail view, select your group, and then click the calendar button in the ribbon. A different experience than clicking the calendar view and then the calendar.


When clicking the Calendar button, a new window opens. In the new window locate your group in the folder navigation pane, right click the group and pick Add to Favorites…

imageIf you go back to the original Outlook window, click to view calendars in the folder view, you should now see your Group calendar in the My Calendars list, much more accessible.


I hope the Groups navigation experience towards the different services proliferate into all contexts and apps over time, but for now this is as good a workaround as any to have Group calendars appear side by side with your other calendars.

Want to remove the calendar? Use the same approach, but Add to Favorites has turned into Remove from Favorites.

Friday, June 3, 2016

Bringing out the client side hammer - The one thing you should learn about SharePoint search in 2016


SharePoint 2013 has been out for a good while now with SharePoint 2016 well on it’s way, and over the years there are some major flaws which has crystalized itself to me in SharePoint search - especially if you are working in SharePoint Online. So if you plan on learning just one thing about how SharePoint search work this year, this post is for you!

The top four flaws in my opinion are:

  • Best bets / promoted results via query rules
  • Synonym handling / Thesaurus
  • How query rules trigger
  • Remove custom noise words from the query

This post covers a client side solution to solve the last three points above, and I started this back in January based on a conversation with Thomas Mølbach at Microsoft about solving synonyms in SharePoint Online. I’ve had it linger for a while and finally Elio Struyf finished the code and pushed me to get it out there. The solution can be found at the the Github SPSCR project.

Tuesday, May 24, 2016

Workaround to filter on taxonomy columns using OData filters instead of CAML using REST in SharePoint

Wow, that was a long post title indeed. The thing is, you cannot use OData filters on taxonomy columns in SharePoint, hence you see posts on the interwebs about using CAML instead to filter on taxonomy fields by using this construct:


And this works just perfect. But if you try to add a field expansion at the same time on a lookup field, then it blows up. So you can either do an $expand=MyLookupFiled on the /Items endpoint or filter using CAML on a taxonomy field using the /GetItems endpoint.

What if I told you that you can accomplish both using a workaround!! You may either contact me and pay up, or continue reading for free :)

Monday, May 23, 2016

Diagram on adding a new content source in SharePoint

Looking for a Visio file I discovered this one which I forgot to publish some time ago. So here’s a small diagram you can use when adding a new content source to cover the most important aspects you need to think about when adding it.

There are more complicated scenarios of course, and feel free to reach out if you have any questions.

Friday, May 20, 2016

Appending query terms to a search URL

I have written about appending query terms before without having them in the search box, and I’ve missed out at the best approach for this until now. Sometimes it takes years for the obvious solution to step forward.

In SharePoint 2010 you could add a= to a query and the terms on the a parameter would be included in the query as a hidden constraint. So how best to do something similar in SharePoint 2013/2016 or SharePoint Online? You modify the query template!!

A simple query template like {searchboxquery} {?{\QueryString.a}} will take the value of the a parameter and append it to the query. Problem solved, and you can keep existing code if you migrated even.

Craft a query like: and the query will filter to items where title includes the term bar, but not show it in the search box.

Wednesday, May 4, 2016

Introducing SharePoint Framework!

Today Microsoft announced SharePoint Framework, the framework which will take SharePoint web development into 2016. At last, client side development has become a first class citizen of SharePoint development, and developers can use the open source framework of their choice like React or AngularJS to develop web parts, pages and views in SharePoint like there was no tomorrow!
Want to read more? Take a peek at my article on and see a demo of what I’ve built using this new framework being part of an early test group. Or head over to the official Microsoft blog post.

Monday, May 2, 2016

Hello, it is you we are looking for!

imageAre you an opinionated gutsy person in the Oslo, Norway area with at least some work experience who want to work with Office 365 and SharePoint? Maybe you should get in touch with Puzzlepart, ‘cause we’re hiring!

We’re a mix of nutty, crazy and passionate people, so if you love having fun at work while also delivering real business value feel free get in touch.

You’ll find my contact information in the right column of this blog :)

Thursday, April 28, 2016

Search your internet site via Bing in SharePoint

I’ll credit this post to Dean Gross who did the legwork, and builds on my previous post about showing external RSS feeds in SharePoint via Search. If you want proper rendering of the results make sure to visit the post.

You might want to list some internet results on your SharePoint pages, and you can do this creating a new OpenSearch result source targeting Bing which supports RSS as a return format of results.

Create a new Result Source at the level of your choosing, set it to use OpenSearch 1.0/1.1 as the protocol and paste this URL in the Source Url field: {searchTerms}&count={itemsPerPage}&first={startItem}&mkt={language}&format=rss

The above URL will lists items from this blog.


Drop a content search web part on your page using this result source and you are good to go!

If you’re not passing in a search term yourself, remove {searchTerms} from the URL.

Setting up Azure Business to Business (B2B) access for use with SharePoint Online

SharePoint Online’s support for sharing sites and documents with external users has been there a while now, but sharing with each individual users is quite cumbersome if you have to share with a volume of users. This is where Azure B2B comes into play, and the Azure team has good information on this over at Github.
Steps covered in this post:
  • Create AAD security group
  • Enable external sharing in a site collection
  • Add AAD security group in the site’s Members group
  • Create and upload CSV file with all external users to AAD
  • Accept invitation and have bliss!

Search behavior of automatically created managed properties

When you create site columns in SharePoint they will have automatically created crawled and managed properties created for them. The naming convention for the properties is explained in detail at TechNet, but it doesn’t mention what properties are set for the associated managed properties.

As far as I know this is the behavior:

  • All managed properties are set to retrievable
  • All managed properties are set to queryable
    • except multi-line and pub image/html/link fields
  • Taxonomy fields are also set to searchable (which makes no sense what so ever to me)

Thanks to Graham Sheeley for the idea for this post :)

An approach to cleaning up search schema changes in a site collection

Graham Sheeley posted a question in the Search Explained Yammer network about how to undo search schema changes at the site collection for SharePoint Online (which also applies to on-premises).

The difficult part here is to know what changes have actually been done to the schema so you can undo them. There is no magic undo button, but here’s a working procedure to remove any unwanted changes.
  1. Go to site settings for your site collection
  2. Click Search Configuration Export below Site Collection Administration
  3. Open the exported xml file in your favorite text editor, as this file will contain only the changes made at the site collection level
  4. Look for the SearchSchemaConfigurationSettings node
  5. In the ManagedProperties nodes you will find new managed properties which have been created, in the image below a new one named MikaelKnowsHisStuff
  6. Re-crawl content to weed out values from the index
If you have made mappings to existing managed properties you will see these listed in the Mappings node and have to examine and possible compare with a blank site to see which have been added or removed.

Unfortunately it’s not a simple undo operation, but at least possible. This is also why I strongly advocate to re-use the reusable managed properties for your custom use, as it’s quite easy to see any mappings done in the UI, as long as you know which ones might be globally mapped.


Wednesday, April 27, 2016

Gotcha when administrating multiple MMS’ in SharePoint


If you create more than one managed metadata service in SharePoint and want to enter one of them via Central Admin, make sure BOTH are checked off as available services for the Central Admin web application. If only one is selected, then clicking either MMS will take you to the one assigned to the web application.

Thursday, April 21, 2016

Why the community is awesome!

I’m building out a custom form for a customer using AngularJS and Office UI Fabric. And I’m using the ng-officeuifabric directives to do so.

In my case I needed a multi-line text field. When I started out my project multi-line had not yet been implemented in the <uif-textfield> directive so I went with the markup directly from Office UI Fabric instead. Along the way multi-line support got added, but there was an issue that if you clicked within the textbox on the label, the control did not activate – you had to click beside the text in order for the textbox to get focus.

I headed over to the github site for ng-officeuifabric and logged an issue on it. Soon after Andi Krüger picked it up, created a branch with a fix and I got an e-mail alert to take a look. I pulled down the branch, built-it, found and fixed a bug where it didn’t check for single line or multi-line, which I notified Andi of on the projects Slack channel. Boom, issue resolved in less than 24h.

Came back from lunch and Andrew Connell has merged Andi's PR on the matter and a new npm package was readily available. Ran "npm -update" and I was good to go with the latest release.

That's how AWESOME the community is!

Thursday, April 7, 2016

Considerations when upgrading WSP’s from one SharePoint version to another

I’m currently helping a government client move a SharePoint 2010 farm over to SharePoint 2013, but this post is just as valid if you move solutions over from 2013 to 2016.

The backdrop for the migration is that they have numerous WSP’s with server side code, and when migrating to SharePoint 2013 they decided to keep the server side code instead of moving over to a client side model. A decision made before I was involved, but it’s a valid one for many scenarios.
Before delving into some upgrade paths you can take and the one chosen, let’s sum it up!

Lesson learned

Be smart, plan ahead and think well before you involve your favorite consultant on the migration path – it might be one of the last tasks he or she will help out with, regardless how nice and forthcoming they are.

When migrating from one SharePoint version to another keeping server side code, do the simplest thing possible with the least amount of moving parts. Do not mix in code refactoring's and changes as part of the process. If you do feel the urge to do so, then create new solutions which can co-exist side by side with the 2010 packages, and save yourself a lot of grief and swear words if you’re inclined to those.

Planning a SharePoint upgrade and want help? Feel free to contact me or Puzzlepart and we’ll be happy to forward you to someone who likes these kinds of tasks. If you however want to move from WSP’s to a client side model as part of the migration we’d be happy to assist :)

Friday, March 11, 2016

SharePoint Query Tool v2.5 released


The most notable changes in this release are:

  • Saving of query/connection presets
  • Toggling of hidden constraints in the UI
  • Show the final query including modifications
  • Removal of 2013 in the tool name

Get the full changelog and binaries over at

Thursday, March 3, 2016

Updates to Office 365 Video

Creative Commons by torbakhopper

Seems the team behind Office 365 Video has had a ketchup effect lately and recently released new feature to the service, which in two weeks time have rolled out from first release to production. Pretty cool stuffs!
  • Insert O365 Video from a SharePoint page
  • Video Statistics and Analytics
  • Improved upload flow
  • Subtitles & Captions support

Monday, February 22, 2016

When query by content type name use SPContentType and not ContentType

If you are to query in SharePoint using search using the name of a content type, be sure to query using the managed property SPContentType and not ContentType. The latter contains extra data, and will usually fail you.

Use SPContentType=Document, and not ContentType=Document

Of course you can query using ContentTypeId instead if you have the id.

Tuesday, February 16, 2016

Why you should back up your term store in SharePoint Online

Short version, if you delete a term, you cannot easily restore it.

But it is possible! (solution at the end of the article)

Monday, February 15, 2016

Using SPServices to help populate fields in a SharePoint form


I know SPServices is old skool and so am I. We both go very well in hand with web services indeed, but we do enjoy the occasional re-write to new world of REST. Honestly!

I have a form where based on a lookup to another list I should populate, or copy values, over to some fields. Pretty simple task, which is not out of the box.

As I hate writing plumbing code I pinged Marc Anderson and found out that his SPServices library has a method named SPDisplayRelatedInfo. This method is meant to be attached to the drop-down tied to the look-up list, and will pull in related data and render it as an inline table.

(Image borrowed from

In my case I wanted to populate the Site name, Department and Responsible person based on the item selected in the below drop-down.


Thursday, February 11, 2016

Search schema mapping level explained

In SharePoint search you can map a crawled property to a managed property at basically three different levels. On-premises farm have SSA, site collection and site, while SPO have Tenant (subscription), site collection and site.

Search Service Application / Tenant

This is the top level, and mappings done at this level are inherited down to all site collections and sub sites.

Mappings for content outside of a SharePoint site collection like user profiles, hybrid crawled data, bcs, file crawls etc HAS to be mapped at this level.

Site collection

Mappings at a particular site collection will have effect for content stored on that site collection only, and only for searches executed in the context of the site collection. The last part is important. If you search center or search page is residing outside of the site collection where you did the mapping, then the mapping is not applicable. Any mapping is also inherited down to sub sites.


Only for viewing the schema - no mapping possible.


If you map on a level besides the SSA/Tenant level, make sure the content you are mapping for resides at the level you map, and that queries executed also run in the same context. This means for a REST query you would set the API url to target the full URL of a site collection if that’s where the mapping is – https://server/site/mysite/_api/search/query, and not https://server/_api/search/query.

Read more at and

Wednesday, February 10, 2016

Scenario where you do not want to use output caching in ASP.NET (MVP/WebAPI)

Always fun to get to the bottom of weird issues when you didn’t write the code yourself.

Take a look at the following method declaration.

[OutputCache(Duration = 3600, VaryByParam = "none", Location = OutputCacheLocation.Any, NoStore = true)]
public async Task<JsonResult> GetCurrentUser()
    var userId = UserHelperFunctions.GetCurrentUserId();
    var userName = UserHelperFunctions.GetUserName(userId);
    var hasPrivilege = <check admin access>

This is what happens, User A logs in and retreives user data, and within the next hour, every other visitor will get user A’s information. Also pay attention to line 6


There are ways to solve this, for example like in this SO question, but for now I’ll set it to the below to make sure it’s not cached at all.

[OutputCache(NoStore = true, Duration = 0, VaryByParam = "*")]

A small alfanumeric sorter with numeric padding

I just got a support task where I’m pulling data from an API and need to sort the items based on a chapter like key. The data looks like this:

  • ST.1.1
  • ST.1.2
  • ST.1.10
  • ST.2.20a

The data is coming back random, and if I do a pure alfanumeric sorter, then ST.1.10 will sort above ST.1.2, which is lexically incorrect. Since I know I will never have numbers above three digits (ST.999.999), I figured I could sort it all by padding the numbers. This is the solution I ended up with, and if you have a smarter one let me know :)

I’m matching right to left in the regular expression as this makes it easier to replace the string as indexes are not changed when inserting characters.

class Program
    static void Main()
        var demo = new List<string> { "ST.1.1", "ST.1.10", "ST.1.3c", "ST.1.3a", "ST.1.2" };
        demo = demo.OrderBy(PadName).ToList();
        //output is: ST.1.1 ST.1.2 ST.1.3a ST.1.3c ST.1.10

    static readonly Regex _reNumber =
       new Regex(@"\d+", RegexOptions.Compiled | RegexOptions.RightToLeft);
    static string PadName(string name)
        foreach (Match match in _reNumber.Matches(name))
            string newNumber = match.Value.PadLeft(3, '0');
            name = name.Remove(match.Index, match.Length)
                       .Insert(match.Index, newNumber);
        return name;

Tuesday, February 2, 2016

"I Want to Believe" - Is Microsoft abandoning the enterprise features of enterprise search?

I want to believe that Microsoft has not abandoned the enterprise in enterprise search, and that the good people behind the FAST seearch engine still are allowed to deliver well tested and proven features around the SharePoint search space.

If features are removed, as they were from FAST ESP to FAST Search 2010 from SharePoint, and from FAST Search 2010 for SharePoint to SharePoint 2013, then remove them first after you have tried to advocate the use of them. Just because a feature is not used by the average SharePoint consultant/pro-user, does not mean it’s not valuable. It might be that they just don’t know about it, or don’t know how to put it to good use.

To set the scene for this article, enterprise search is the practice of making content from multiple enterprise-type sources, such as databases and intranets, searchable to a defined audience. And over the years, companies have learned to expect a certain set of features from solutions delivering enterprise search. Wikipedia lists enterprise search having five components:
  • Content awareness
  • Content processing and analytics
  • Indexing
  • Query processing
  • Matching

The present

Before Microsoft dropped FAST ESP and Search Server as separate products they were a player in Gartner’s magic quadrant for Enterprise Search. But as they no longer have stand-alone search offerings, you won’t find them there today. When Microsoft was a part of the quadrant they were in the upper right corner for being both visionary and having the capability to execute. If Microsoft had a separate product in the quadrant today, would they still be in that coveted position?

On the execution part I think yes, as SharePoint 2013 is widely rolled out and SharePoint Online tenants are popping up at a steady pace. Visionary wise, I’m not so sure. With SharePoint 2013 Microsoft gave companies the query rule framework. If you know how to utilize it, the query rule framework is one of the coolest search features out there when developing search-based solutions. When it comes to the indexing and query features coming from FAST ESP, however, we have seen a decline in the feature set. Where FAST ESP gave you full control and FAST Search 2010 for SharePoint locked it down in terms of full customization, SharePoint 2013 has ridden itself of much of the capabilities to tune relevance and control how indexing works. In retrospect, Microsoft seem to have cut some corners on the SharePoint 2013/SPO search features and on the testing of the features that are included.

And don’t be fooled to think Microsoft is not aware of this. There are people out there who care about search functionality, like me, who have in both official and unofficial channels voiced their opinion on the state of Microsoft search within SharePoint.

On-premises features

Don’t get me wrong that it’s all dark ages, because there are some very good features in SharePoint search today that indeed are enterprise grade. I already mentioned the query rule framework, and dictionary extraction and content enrichment via a web service are also prime examples. The enrichment capability makes it a lot easier to do massaging of content to accomplish simple contextual and targeted experiences for the end-user. Could they have been even better? Sure. Those two features are better than FAST Search 2010 for SharePoint offered, but inferior to what FAST ESP offered.

For those not familiar with enriching capabilities, you use them to look at the text and metadata of the content being indexed and then add on even more content to the search index. That could be categorizations or classifications, adding synonyms to disambiguate terms, or applying any business logic you deem necessary.

On the query side, you can still create custom rank profiles used when querying the content to improve the order of how items are returned for users. It’s not for the faint of heart, but once you know how, it’s a very powerful feature – enterprise grade for sure. I would still hold FAST ESP and FAST Search 2010 for SharePoint as winners over the current rank profile offerings, mainly because machine learning plays a part today. Machine learning is hard to comprehend and to tune manually. In theory, machine learning should be superior, if the learning is done correctly.

To sum it up, SharePoint 2013 on-premises and the upcoming SharePoint 2016, which has the exact same feature set as 2013, hits all the five categories for enterprise search mentioned in Wikipedia, but not as well as FAST ESP and FAST Search 2010 for SharePoint did.

Enter hybrid crawl and SharePoint Online

If you decide to take the plunge for the recently hyped hybrid crawl where you index on-premises data into the SharePoint Online search index, or move to SharePoint Online all together, then the story effectively changes. You can no longer do enrichment of the indexed data, and the options for custom rank models are very limited – or useless in my opinion. This might sound harsh, but from a technical perspective, it is what it is.

Effectively point #2 (content processing) and point #5 (matching) of enterprise search have been set back some 10-15 years. Using third-party connector frameworks can mitigate this, but then complexity and cost increase.

Read my blog post Why Hybrid Crawl in SharePoint is a cold hot potato for more thoughts around hybrid crawl.

The future

Where Lucene and Elastic Search-based solutions speak to the developers and allows full flexibility in all parts of the search lifecycle, Microsoft has transformed its FAST search engine from being a flexible kit car to a Prius. I suspect the gasoline engine is still there at its core, but the ease of going electric seems very appealing and friendly to most. Had they gone all-in for a ludicrous mode like a Tesla it would have been a different story.

As of now, if you look to hybrid crawl or SharePoint Online, you do get a cheaper scalable solution, but at the cost of stepping back a decade in functionality. Effectively removing the “enterprise” in enterprise search. Just because you can index a lot of data and have enterprise customers, doesn’t mean it’s enterprise grade search.

Is Office Graph the new messiah?

The Office Graph is definitively a fresh breath into the enterprise search space and the only new search feature launched for SharePoint since SharePoint 2013 entered the market on October 11th, 2012 (and I’m not considering hybrid crawl a search feature per say). To explain in crude terms what the Office Graph does for users, it brings in a new way to rank content based on what you and people like you work with and work on based on recent usage and interaction with content.

Indeed, very useful, although I’m not sure today’s Delve application is the killer user experience to utilize the full potential of the Office Graph. I’ve played with the Office Graph myself, as has others, but I haven’t yet been smart enough to create something useful that I cannot live without on a day-to-day basis.

My Collabograph application, built using the Office Graph, is a fun gizmo playing into the Delve analytics space, but I don’t really need it (and the API has also been discontinued).

That said, Gartner might easily have moved Microsoft up in the visionary quadrant for launching the Office Graph feature, but is it good enough to keep them there in the long run?


Search capabilities in all flavors of SharePoint are still good, and certainly a good contender for enterprise search. Where other solutions lack the wide range of quality, third-party connectors adhering to the source systems strict security control on content access that SharePoint has, SharePoint truly shines. But on the technical side of what you can do with the content during indexing and querying, open source-based solutions and the players in the Gartner magic quadrant looks to have the upper hand today. My wish is that Microsoft should fill in the gaps they forgot back in October of 2012, and also build upon this even further. More capabilities will in general yield more innovation and excellent showcase solutions.

Perhaps the second coming, or comeback if you will, from Microsoft for enterprise grade search is when v2 of the Office Graph programmatic interfaces are made public and we can push all kinds of content and signals into the Office Graph. Or have Microsoft put down their gloves and left the enterprise search arena for good, moving all focus to battle Google and Amazon? That is a large-scale battle with more money to be made for sure.

I’m still a believer in Microsoft as an enterprise search player, and although I have doubts at the current time about the current feature set improving in the near future, I quote Fox Mulder from X-files saying: “I want to believe”.

Friday, January 22, 2016

Do something after all refiners templates have completed rendering

Elio Struyf is a good friend and did a post today which I have shamelessly copied my post title from. Elio missed an approach on how to run code once all refiners (or other search part) has been rendered, so I figured I’d help him out :-)

Be sure to read Elio’s excellent post before you continue!

Wednesday, January 20, 2016

Find people based on taxonomy id’s

The typical scenario shown and used is where you want to list content relevant to a user based on a property on the content and a property on the user profile. For example the Ask Me About property for a user will by default store the terms as enterprise keywords. This means that if you want to list content with enterprise keywords enabled for the current user you can use a query template like:


What if you want to list all people tagged with taxonomy values from a page?

Now we have the exact opposite scenario.

{|AskMeAbout:{Item.TaxKeyword} will work, as it uses the labels and not the id’s. However {|AskMeAbout:{Item.TaxKeyword.Id} will not work as the AskMeAbout field only has labels and not id’s. If you have terms with the same label in different hierarchies, or labels which can be sub-strings of other labels, then this very quickly breaks.

Is there a solution? Of course!

Here’s the magic you need to know. When you have a user profile property tied to a taxonomy, you will get a crawled property named ows_taxid_SPShPropertyName for SPS- prefixed properties and ows_taxid_PropertyName for other ones, with corresponding managed properties named owstaxIdSPShPropertyName / owstaxIdPropertyName. Just like you get for taxonomy based site columns for content.

Switch the query over to: {|owstaxIdSPShResponsibility:{Item.TaxKeyword.Id} and you’re all set. (SPS-Responsibility is the internal name for the user profile property Ask me about.)


The main difference for taxonomy based user profile properties is that the managed property only contains the id’s, not the labels, but it does include the property with and without the #0 prefix as well as the termset id.


Note: The user profile property has to be visible to everyone and marked as indexeable for it show in search.

How I watch movies without disturbing my wife and kid


I’ve been known to like action movies, and in particular what we in Norwegian call “gla’vold” – think Tarantino style, or even Toxing Avenger (can’t discriminate on the genre and quality). These movies work best with a certain volume turned up. As I live in an apartment, it’s out of the question to crank up the volume unless I’m home by myself, because my wife and kid would be seriously annoyed. For years now this has declined my consumption of movies, and when I have self-time I need to choose between coding on some pet project or watch a movie.

Disclaimer: I'm no audiophile, and sound over bluetooth will never be the same quality as if you use a cable since audio is lossy compressed. But who cares when we talk about gadgets :)

Not any more!

A while ago I bought a pair of Nokia Purity BH-940 by Monster bluetooth headphones based on a review by Scott Hanselman. I mainly bought them to act as office headphones serving music and also to by used for Skype calls. As they are noice cancel headphones, they also work for plane rides. Except the review does not mention that bluetooth has a flaw when it comes to audio sound on calls when you use the microphone. The quality is plain and simple crap. 

This has nothing to do with the BH-940’s, but the bluetooth protocol. Listening to music only with my Surface 3 Pro was no problem, but calls not so much. I have now replaced the BH-940’s for Bose QC20’s (earbuds) which I won and hence free, and also a cheap USB headset for talks. Which means the BH-940’s has been sitting in a cupboard for a while. Not sure I would recommend the BH-940's myself, but I happened to have them handy.

One evening surfing the net I came accross the Tosblue X from Telme2 ($69) which can take an optical signal via toslink or a 3.5mm mini-jack, and send it out over bluetooth. I googled a bit on reviews and placed my order.

With the Tosblue X in place my current setup is now optical audio out from my Samsung Smart TV, into a toslink splitter, where one goes to my soundbar/subwoofer and the other to the Tosblue X.

Pairing was super simple, and delay was not noticable to me, so no need to worry about lip sync. I’ve tried a couple of movies now via Netflix and the audio is back! Also tried them listening to a slalom sports broadcast, and the audio detail via the headphones was so much better than the soundbar. Suddenly I picked up all turns and snowsounds as well as some distant chainsaw.

The problem now is that I want to wear them any time I watch TV – which does not sit well with other people in the same room :)

So if you're in need of audio at night without cables, this solution might be a fit.

Tuesday, January 19, 2016

Creating crawl rules for SharePoint search with persistant cookies using PowerShell


There are numerous posts out there on how to programatically create a cookie based crawl rule which will first login at a specific URL, and then use the cookies recived when crawling the content source. This is however the first one on how to do a persistant one.

Here’s a brief sample:

$ssa = Get-SPEnterpriseSearchServiceApplication
#Create rule
$rule = New-SPEnterpriseSearchCrawlRule -SearchApplication $ssa -Path 'http://**' -Type InclusionRule -FollowComplexUrls $true -AuthenticationType CookieRuleAccess
#Add cookie information
$authUrl = ""
$rule.SetCredentials([Microsoft.Office.Server.Search.Administration.CrawlRuleAuthenticationType]::CookieRuleAccess,"pzl", $authUrl)

The above code will before each crawl call the url from $authUrl to get the cookie. The cookie added above with “Pzl” is just a dummy cookie for making the command work.