Installing PowerPivot for SharePoint 2013 as Farm Administrator fails

PowerPivotFarmAdminFeatured

After you install the SQL parts to enable PowerPivot for SharePoint 2013 you need to run the ‘PowerPivot for SharePoint 2013 Configuration Tool’. This configuration tool will deploy the features, services, applications and solutions that are needed by PowerPivot.

If you run this tool, you might receive a validation error stating you need to be a SharePoint Farm Administrator, even if you already have farm administrator privileges.

System Validation

The user is not farm administrator. Please address the validation failures and try again

Error during installation of SharePoint 2013 Workflow Manager

WorkFlow

If you want to use Workflows in your Microsoft SharePoint 2013 environment, you need to install SharePoint 2013 Workflow Manager. You can install the Workflow Manager either on a server that is also running SharePoint or on a separate server and communication between SharePoint is both possible over HTTP and HTTPS. This article on TechNet describes how to install the Workflow Manager.

However, during the installation of the of the Workflow Manager on your (development) environment, can might receive the following error:

Could not obtain information about the Windows NT group/user ‘Domain\ServiceAccount’, error code 0x6e.

Where ‘Domain\ServiceAccount’ is the account configured to run the service.

Differentiating File/Folder in SharePoint Eventreceiver

EventReceiver

You can hook SharePoint eventreceivers to lists and libraries to execute custom code whenever a new document is being uploaded to a document library. The ‘ItemAdding’ event fires when a user adds a new document to a library, but also whenever a new folder is created. However, due to the vast variety of ways to upload a document (one document, multi-document, WebDAV, Office, WebService, etc.), the event always seems to behave a little different.

Having a reliable way to check whether the user added a new document or created a new folder in a document library is key for a solid eventreceiver.

Reading SharePoint querystring values in JavaScript

QueryStringJavaScript

JavaScript is becoming more and more popular as a language for SharePoint solutions. Time to get familiar with the built-in JavaScript repository. I have seen quite of different ways to retrieve querystring parameter values in JavaScript, but SharePoint features it’s own function ‘_spGetQueryParam(p)’.

Modify Permission Levels (using bitwise operators)

permission-level-teaser

The easiest way to create a new permission level in SharePoint is to copy and modify an existing permission level. For example, you can copy the ‘Contributor’ permission level and remove the ability to delete items by unchecking the corresponding option. SharePoint 2010 even provides a ready-to-use out-of-the-box button to copy existing permission levels.

However, modifying permission levels programmatically is a little bit less obvious as the SPBasePermission enumeration is implemented as a bit flag.

Retrieving all (nested) members of a Group

Membership-teaser

You can assign permissions to users, SharePoint groups and Active Directory groups in SharePoint. While SharePoint groups cannot contain other SharePoint groups, it is possible to nest Active Directory Groups. The SharePoint method SPGroup.Users only returns users that are added directly to the SharePoint Group. I have written a small function that is able to retrieve all users of a SPPrincipal object, included nested users.

A weather forecast WebPart using JSONP

Weather-WebPart-teaser

My previous post shed some light on JSONP and how it works. In this post I will describe how to create a cool SharePoint 2010 WebPart that shows weather forecasts. The actual forecast data is retrieved from the Yahoo Weather Service  using a JSONP call.

Cross-domain webservice calls using JSONP

JSONP-teaser

The JavaScript class library for SharePoint 2010 enables developers to create rich SharePoint applications using pure JavaScript. If combined with the jQuery library, the power of JavaScript solutions is limitless,….. or isn’t it.

The Same Origin Policy prevents access to resources on other domains. Put simply; you cannot call a webservice from JavaScript that is hosted on another domain. There is however one exception to this claim; browsers allow the <script>-tag to call JavaScript files that are hosted on another domain. The technique JSONP exploits this opportunity.

Weird bug while updating WelcomePage using C#

weird-bug-while-updating-welcomepage-using-c

You can change the WelcomePage of your site by updating the value of SPFolder.WelcomePage. However, you might experience some strange behavior if your are trying to update this value directly.

Conditionally enable/disable Ribbon buttons based on user permissions

Conditionally enable-disable Ribbon buttons based on user permissions

Using custom action you can create your own ribbon elements. In a post I have published a while ago I showed how to add a button to the ribbon to generate a QR-Code. But what if you want your button only to be enabled under certain circumstances. For example; if the user has sufficient privileges.