Thursday, 16 January 2014

List of "My Sites" with SharePoint 2013

I have constructed a query which returns all site collections and webs. This query is then transformed  into a tree and used to display a list of all sites a user have access to.

The query was not returning all items from the index. If I searched for the sites manually the sites was returned.

When setting "TrimDuplicates" to false all items are returned, but one can also set "TrimDuplicatesOnProperty" to "Path" instead. It have the same effect as setting TrimDuplicates to false.

Wednesday, 2 October 2013

Configuration of PowerPivot

Installing and configuration of PowerPivot on a SP2013 with SQL Server 2012 SP1. I got the following error-message when running the PowerPivot configuration tool:

"The user is not a farm administrator. please address the validation failures and try again"

I´m a farm administrator with my account that is used to configure PowerPivot. The solution to this was to add my account as a secondary owner to the CA site collection.

Wednesday, 29 May 2013

The DataSourceID of ‘TopNavigationMenu’ must be the ID of a control of type IHierarchicalDataSource. A control with ID ‘topSiteMap’ could not be found.

No differences in web.config or errors in the ULS. After a few minutes with ProcessMonitor I noticed "Access Denied" errors for "Microsoft.SharePoint.ApplicationPages.dll" in the "_app_bin" folder.

I was not part of the installation of this SharePoint server and couldn´t tell if some special configuration had been done to cause this.

To solve this I gave "Everyone" Full Control on the file.

Monday, 24 September 2012

Claims, forms and the root site

If you have a web application configured with claims (in this case with Windows authentication) in SP2010 and want to use People Picker control in an Infopath form. Make sure you have a site collection at root (http://nameofapp/) which all users atleast have read access to.

I got the following error in the event viewer if the root site collection is not created and readable for all users:

"an exception occurred in ad claim provider when calling spclaimprovider.fillsearch(): access denied.."

You can also set the ULS category "General" for "SharePoint Foundation" to see this behaviour.

Friday, 14 September 2012

SP2013 Beta 1 - Import photo to User Profile Application

Permissions needed for the user running Update-SPProfilePhotoStore cmdlet

1. Full Control policy on the web application that hosts My Site
2. Full Control permission on the "Administrators" for User Profile Application

Wednesday, 9 November 2011

Error launching Report Builder from MOSS 2007

SQL Server 2008 R2 with SP1 on Windows Server 2008
SharePoint 2007 (Dec 09 CU) on Windows Server 2003

"Edit in Report Builder" sends the the browser to


which redirects to


Now the type "Microsoft.ReportingServices.SharePoint.Soap.RSProxyHttpHandler" takes over the request (see httpHandlers section in web.config for WSS virtual directory)
and should send the manifest to the browser from the SSRS server.

This didn´t happen in our environment.
So we reinstalled the SP2 on the SSRS and it solved this problem.

Things to remember:
* The files in "\ISPAI\ReportBuilder" are not the same on MOSS and SSRS.
* "/_vti_bin/ReportServer" have a custom httpHandler definied in web.config.
* Fiddler helps, but only to a certain point.
* Make sure to run the Add-in installation as a Farm administrator.

Friday, 17 June 2011

XML definition for ContentType

If one don´t include the FieldRef for a column in the FieldRefs collection of the ContentType (for the schema.xml in the List Instance) then the field is not available in the SPContext.Current.Fields collection.

Wednesday, 6 April 2011

Decrypting error in multi-forest environment

In the ULS for a SharePoint 2010 Server after a trust between two domains has been re-configured: Decryption failed with error 0:" (and the rest of the callstack) Solution: stsadm -o setapppassword -password "SomeString" (on all WFE:s) stsadm -o setproperty -pn peoplepicker-searchadforests -pv "ForestDomainUserString" No IISResets needed.

Tuesday, 22 February 2011

Update-SPProfilePhotoStore and Service Application permission

Running Update-SPProfilePhotoStore -CreateThumbnailsForImportedPhotos 1 -MySiteHostLocation https:///my based on User Profiles – Picture Property in SharePoint 2010.

This command requires Full Control on the "User Profile Application" service application (Use the Permissions tab on the Manage Servcie Applications page).

Sunday, 9 January 2011

Solving ‘Configuring certificate’ hang for User Profile Synchronization Service.

The quick explanation:

1. If you re-provision the UPA service and encounter an error while creating the certificate, check this blog post by Paul Culmsee: More User Profile Sync issues in SP2010: Certificate Provisioning Fun.

2. If you delete the certificate in Trusted Root Certification Authorities and still are stuck on ‘Starting’ you also need to delete the certificate “higher up” in the certificate chain at Personal –> “ForefrontIdentityManager”.

A few good pointers:

Start to put the User Profile ULS category to Verbose, then read this blogpost by the SharePoint Escalation Team. Compare the ULS log entries you got with the blogpost, it´ll show where in the process the provisioning fails.

To unprovision the service run the powershell command: Stop-SPServiceInstance –Identity ‘'GUID’

Get the GUID by “Get-SPServiceInstance”, if you have more than one SP server in the farm you have two instances of the service name ‘User Profile Synchronization’, the one which is active has the status “Provisioning”. You might also need to delete the “UserProfileSyncronizationSetup” job before the unprovisioning can start.

In my case I could disregard these error messages in the ULS logs:

ILMPostSetupConfiguration: ILM Configuration: Validating installation of SQL Service. ILM Configuration: Error 'ERR_SERVICE_NOT_INSTALLED' ILMPostSetupConfiguration: ILM Configuration: Validating installation of SQL Service FAILED

Update: Another case required the removal of all subfolders in the MaData folder. I had alot of errrors regarding MS DTC before the removal

Thursday, 9 December 2010

Error message when adding a new column:

Culture ID 1164 (0x048C) is not a supported culture.
Parameter name: culture

The file "Microsoft.SharePoint.ApplicationPages.dll" has not been updated in the app_bin folders for each virtual server.

1. Stop the IIS service.
2. Copy the file from 12Hive\Config\Bin to all app_bin which have SP installed
3. The version of the file "Microsoft.SharePoint.ApplicationPages.dll" should be "12.0.6548.5000"
4. Start the IIS service again.

Friday, 3 December 2010

Downgrade of Enterprise to Standard editon for Sharepoint 2010

Downgraded a SQL cluster from Enterprise to Standard edition. Removed the cluster nodes first, followed parts of this guide to downgrade the edition and then configured the cluster again (most time was needed for the cluster configuration).

If you don´t restore the master database, you need to run "GRANT VIEW SERVER STATE TO [MyDomain\FarmAccount]" to avoid flooding of "Event 5586" with error message "
The user does not have permission to perform this action."

One thing that is not to obvioulsy is that the "Property Store" and "Web Analytics Service Reporting" database uses Enterprise functionality and can not be attached to a Standard edition.
You need to recreate the Service Applications for the Search Service and Web Analytics. So plan for it beforehand.

The Search Service can not be deleted i the UI, check this how to use stsadm to delete it. You also need to delete the Search DBs in the same way or else the Event viewer will be filled with connection errors for the orphan databases.

Wednesday, 10 November 2010

Code example for EnabledScript element in Ribbon XML

Andrew Connel explains how to enable and disable buttons in the Ribbon based on a condition.

I need to check a field value on the selected item and the item permission and then enable / disable multiple buttons. I assume that you have some knowledge about the Ribbon XML structure :).

//Should only be enabled when IssueStatus == Report

//Should always be enabled

function SingleEnable(EnableForStatus, PermissionKind) {

var result = false;

var selectedItems = SP.ListOperation.Selection.getSelectedItems();
var ci2 = CountDictionary(selectedItems);
if (ci2 == 1) {

if (this.IssueRibbonItemId == null) {

this.IssueRibbonItemId = selectedItems[0]['id'];
var listGuid = SP.ListOperation.Selection.getSelectedList();
getStatus(this.IssueRibbonItemId, listGuid);

else if (this.IssueRibbonItemId != selectedItems[0]['id']) {

this.IssueRibbonItemId = selectedItems[0]['id'];
var listGuid = SP.ListOperation.Selection.getSelectedList();
getStatus(this.IssueRibbonItemId, listGuid);
else if(this.IssueRibbonStatus != null){

if (this.IssueRibbonStatus == EnableForStatus || EnableForStatus == '') {
result = true;

return result;

function getStatus(ItemId, listGuid) {

var clientContext = new SP.ClientContext();
var web = clientContext.get_web();
var lists = web.get_lists();
var list = lists.getById(listGuid);
this.IssueItem = list.getItemById(ItemId);

clientContext.load(IssueItem, 'IssueStatus', 'EffectiveBasePermissions');
clientContext.executeQueryAsync(Function.createDelegate(this, this.onStatusQuerySucceeded), Function.createDelegate(this, this.onQueryFailed));

function onStatusQuerySucceeded(sender, args) {
this.IssueRibbonStatus = this.IssueItem.get_item("IssueStatus");
RefreshCommandUI(); //Makes the EnabledScrip method to be enabled again.

function onQueryFailed(sender, args) {
alert('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace());

Monday, 1 November 2010

Some TaxonomyField things and code

Before a new term can be used for tagging in a web site it needs to be added to the hidden list "TaxonomyHiddenList".
Several suggestions how to add a new term with code has been posted and this is my conclusion:

Adding a new term to an item:

TaxonomyField tf = item.Fields["ColumnName"] as TaxonomyField;

This doesn´t work for new items:

int hiddenTermId = -1;
int[] wssIds = TaxonomyField.GetWssIdsOfTerm(site, TermStore.Id, TermSet.Id, Term.Id, false, 1);

if(wssIds.Length > 0)
hiddenTermId = wssIds[0];

TaxonomyFieldValue tfv = new TaxonomyFieldValue(termId + ";#" + term.Name + TaxonomyField.TaxonomyGuidLabelDelimiter + term.Id.ToString())

or this:

string termString = String.Concat("-1", SPFieldMultiColumnValue.Delimiter, term.GetDefaultLabel(1033));
TaxonomyFieldValue tfv = new TaxonomyFieldValue(termString);

Add a comment if you have any question.