* You are viewing the archive for the ‘Performance’ Category

SharePoint folder performance

In a recent project we had the idea to use folders as a starting position for queries to optimize the performance a bit further. To set a starting folder on an SPQuery object you need to set the Folder property to the SPFolder object you wish to search.

This is what this post is about: how to get that folder (by name) in C# in a performant matter.

Let’s get down to business: what I would like to do is write a function that takes in a folder name and it returns me the SPFolder object (in the … Continue Reading

Getting random user profiles

Getting random user profiles is quite an easy task, but there is not much to be found on the internet about it except for some less than ideal solutions in my opinion.

My ideal solution would be something that is scalable and takes into account the security of the User Profile Application.

The solutions that I found all shared the same approach:

  • Open the User Profile Application Service
  • Get the count of user profiles
  • Get X numbers between 0 and the number of user profiles
  • Get those user profiles

I do have some issues with this which I would like to point out:

The count of the number … Continue Reading