Matomo (Piwik) and SharePoint – Tracking on Sites with Minimal Download Strategy or Search

Using Matomo (Piwik) with SharePoint can be very straight forward. There is no need to install any extension for SharePoint or any .wsp solution. All you need is Piwik installation and some lines of JavaScript in a file and a bit of PnP PowerShell.

Piwik offers you a default JavaScript snippet that allows you to track a user on your web site. The default code will somehow look like this:

var _paq = _paq || [];
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
(function () {
	var u = "//";
	_paq.push(['setTrackerUrl', u + 'piwik.php']);
	_paq.push(['setSiteId', '1']);
	var d = document, g = d.createElement('script'), s = d.getElementsByTagName('script')[0];
	g.type = 'text/javascript';
	g.async = true;
	g.defer = true;
	g.src = u + 'piwik.js';
	s.parentNode.insertBefore(g, s);
})();<span id="mce_SELREST_start" style="overflow:hidden;line-height:0;">&#65279;</span>

As soon as you save this JavaScript code in file, you can get started with SharePoint tracking with the following steps:

  1. Upload this file to your SharePoint Root Site Collection and place it in the Style Library (Why? Regularly I use this lib as a on-premises CDN)
  2. Make sure the file is accessible
  3. Create a Script Link in the Site Collection you want to track.

For step 3 You can use the following PowerShell code to add a script link to your site collection:

Connect-PnPOnline -CurrentCredentials -Url
Add-PnPJavaScriptLink -Name SpPiwik -Url "/Style Library/SpPiwik.js" -Sequence 900 -Scope Site

With this setting you can track a user and gain basic insights about his flow through your website. The data you are gaining by now is very basic and there are some SharePoint only specialties:

Read More »

Configuration of PHP and MySQL on Windows Server with IIS

Recently I challenged myself to see how far we can go with PowerShell DSC and non Microsoft Products. My goal in this challenge was to install and configure PHP and MySQL on a blank Windows Server 2012 R2 offline server.

Why would someone do this?

Because I wanted gain a better understanding on how far PowerShell DSC configurations are useful in challenging tasks with non Windows or Microsoft Products. Another outcome should be a fully functional PHP server to host PIWIK for a SharePoint Farm.

Read More »

Angular Elements – the future of ngOfficeUiFabric

Vesa Juvonen gave a great keynote at the European SharePoint Conference in Dublin on Thursday last week . It was filled with many announcements supported by a fantastic speaker line up. The biggest news were about SPFx and ALM in SharePoint Online.

Keynote by Vesa Juvonen and Rob Wormald about Angular Elements in SPFx WebParts

The moment Rob Wormald from the Angular Team joined Vesa – very unexpected for a conference focused on Microsoft technology – great developments were inntroduced: Angular Elements.

Angular – A google project – is widely used in modern web development and currently there are no best practices available for using Angular in SPFx webparts. Currently the best option is: avoid using Angular in SPFx right now.

What are Angular Elements?

It’s Angular Components as web components. Web components can be used in SharePoint Modern Sites and any other JavaScript apps. The new elements will blend in every other framework.

This makes Angular Elements way more versatile in usage and handling in combination with other Frameworks like e.g. React.

The dependency on the virtual DOM and the way SPFx webparts go through a process of packaging, made the usage of Angular in SPFx webparts not attractive. If you were still going with Angular, there are very likely chances you will run into troubles or performance issues, when you try to insert more than one of your Angular SPFx webparts.

The biggest step with Angular Elements comes with: “How can it be used in a page?” The dependency on a root element becomes obsolete! This means Angular Elements is just plain JavaScript without any further dependencies after the step of compilation. This makes Angular Elements a valuable option in SPFx.

Whats the effect of this new Angular Elements for ngOfficeUiFabric?

In case you haven’t seen Andrew’s post: HERE! I think Andrew is one of the few people who can explain this difficult topic in an understandable easy way!
There are plans to start of with Angular Elements for ngOfficeUiFabric. I hope this ngOfficeUiFabric@Next project will start to fly soon.

Hackathon @ European SharePoint Conference 2017

This year’s hackathon was a blast. Stephan and I partnered with Thomas and Saulius to defend last year’s victory (See Vesa’s blog post).

ESPC17 Hackathon

The hackathon started off with Mike’s introduction and a quick review on the last year’s results. Mike loves to hack and you can feel his passion for programming, when he introduces the concept of hackathon: “There is no good hackathon without pizza and beer!” 🙂

The hackathon rules and experts to support the teams can be found here: ESPC Hacakthon

This year our new formed team came up with an idea to do something with bots and Office 365. In the end we tried to revolutionize support activities focused on Office 365: “SharePoint Assistant” was born.

SharePoint Assistent is a predictive QnABot that guesses what the user needs – based on prior usage of the bot or the current user context. The bot can be embedded in an SPFx Extension Webpart in any SharePoint Online site collection. Other options would be to integrate this bot in Teams, Skype and many more.

You can find the whole team and the result presentation in this devpost submission: SharePoint Assistant

The competitors had really great ideas and I was totally impressed by the winning teams solution – Our team was the follow up though.

The winning team used the SharePoint audit logs to create Yammer communities based on analysis. The solution was that impressive because they used fairly simple tools to automate the whole process. Flow, Excel, Data pools were the names of the most used tools.

Another team automated their process of coffee delivery to their offices. They integrated a small circuit board through an email flow into Office 365.

There were further more two solutions shown on how to create PDF documents form Excel or Word directly in an SPO library.

Hacking during the European SharePoint Conference is fun. It allows to break out of the day to day life, get to know new technologies and shows what’s possible with Office 365, Azure and the developers tool belt.

Thank you, Mike and VESA for making this possible!

The self-healing environment – PowerShell DSC for your SharePoint Ecosystem – Recap

During my preparations for Dublin I came across many topics in the Azure Automation world I wanted to automate as well. Currently the resources “on how to do this” are limited to the Microsoft Documentations available.

I planned to on-board a newly provisioned virutal machine in place and join this server into my automation account. A process I do on a day to day basis with development environments.

I tend to trash my virtual development machines on a regular basis. This process allows me to be assured that my systems are up to the customers requirement.
This means I upload the customer specific configuration and compile the DSC prior to joining the VM.
If you do already have a configuration in place and want to reuse this, you can go to step number 3.

What is the process of on-boarding a virtual machine to an Automation Account?

0. Login in to your Azure Account


1. Upload your latest DSC configuration to Azure Automation DSC

Uploading a configuration requires you to run the following PowerShell Script.

Import-AzureRmAutomationDscConfiguration -SourcePath "<Full Path to your Configuration>"`
-ResourceGroupName "<Your Resource Group Name>" `
-AutomationAccountName "<Your Automation Account Name>" `
-Published `
-Force `

2. Compile your configuration

After an successful upload you can start the compilation of your configuration. In case the configuration requires parameters, you can ass them into the cmdlet as hashtable:

$dscCompileParameters = @{ }

Start-AzureRmAutomationDscCompilationJob -AutomationAccountName "<Your Automation Account Name >"`
-ConfigurationName "<Name of your configuration>" `
-ResourceGroupName "< Your Resource Group Name>"`
-IncrementNodeConfigurationBuild `
-Parameters $dscCompileParameters `

3. Join a VM to your Azure Automation Account – using PowerShell

Register-AzureRmAutomationDscNode -AzureVMName "<Your VM Name>" `
-ResourceGroupName "< Your Resource Group Name>" `
-AutomationAccountName "<Your Automation Account Name >" `
-RebootNodeIfNeeded $true `
-NodeConfigurationName "<Your Node Configuration Name >" `
-ConfigurationMode "ApplyAndAutocorrect" `


With these few lines of PowerShell you will be able to onboard a VM to Azure Automation and configure this machine to use a specific configuration.

Microsoft Identity Manager and (several) SharePoint Management Agents

With Microsoft Identity Manager and SharePoint 2016 Microsoft changed the way on how to synchronize user profiles between Active Directory and SharePoint 2016. SharePoint 2010 and 2013 did integrate the Forefront Identity Manager (FIM).

In the past I had many problems with FIM. Sometimes the FIM Service did not start or was stuck starting. Some other times the sync did not synchronize….

I really like the idea of having an independent server that manages the sync of user profiles. I installed Microsoft Identity Manager (MIM) on an extra server.

Microsoft offers a toolset on GitHub to configure MIM with SharePoint 2016. Sadly, Microsoft does not process the pull requests…

A few weeks ago, I had the need to configure one MIM with several SharePoint Farms.
Trevor obviously had the same need:

Are there any prerequisites?


Microsoft released several MIM versions:

  • First Release – Version 4.3.2064
    • Service Pack 1  – Version 4.4.1237
  • MIM with Service Pack 1 – Version 4.4.1302

Before you go any further, make sure to have the latest MIM 2016 SP1 RTM installed. This will be the prerequisite for any further patching.

Also make sure to download MIM toolset from: MIM toolset and patch the PowerShell Module with Trevor’s or mine PRs or download my modified module (see further down). Otherwise you won’t be able to run the configuration with the latest version of MIM.

How to configure the toolset for MIM to create (several) SPMAs?

The toolset for MIM comes with a PowerShell Module “SharePointSync.psm1”. We will have to do some modifications to this file to configure (multiple) SharePoint Management Agents.

Read More »

How to change the Office Web Apps / Office Online Server Certificate

Changing certificates is a simple task – not very demanding – but in case of Office Web Apps and Office Online Server there is more to do. I will use Office Online Server as a synonym for Office Web Apps in the article. There is no difference in the process.

Before you change the IIS certificate, hold in, and think about the Office Online Server Farm setup:

Remember this command?

Set-OfficeWebappsFarm -CertificateName "YourShinyNewCertificateFriendlyName"

You will need to run this command to set the new certificate for your Office Online Server farm. But, before you start right way, please make sure these conditions apply:

  • Be sure, that the certificate is installed on every server in your Office Online Server Farm
  • Be sure, that the friendly name of the certificate is set to the same value on each server


SharePoint Distributed Cache 101

In the last time I have seen many SharePoint Farms (2013 and 2016) on which the distributed cache was not in a healthy state or not available at all.

Before you start with any configuration make yourself familiar with distributed cache:



Distributed Cache – Cheat Sheet

The distributed cache is one of the service applications you should not configure via the central administration. So, start your PowerShell as administrator! 😉

I will update this post regular, as there is always something “new”.


Get (all) Distributed Cache Service instances

Get-SPServiceInstance | ? {$_.TypeName -eq "Distributed Cache"}

To get the service instance on a specific server (In this case: the current one). Run this command.

Read More »

Visio Web Access Part not working

From a user’s point of view: I really like the Visio Services in SharePoint 2016
From an administrator’s view: finding the source of an error in Visio Services can be a real pain!

Failed to get raster diagram for Visio file: Default Page ID Exception

The error for the user is not very helpful:

Visio Services was unable to display the requested page because it does not exist within this Web Drawing. To resolve this issue, make sure to request a page that exists within this Web Drawing.

The error message in the ULS log – nah:

Failed to get raster diagram for visio file https:///.vsdx page default page ID Exception : System.ServiceModel.FaultException`1[Microsoft.Office.Visio.Server.GraphicsServer.VisioGraphicsServiceFault]: The creator of this fault did not specify a Reason. (Fault Detail is equal to Microsoft.Office.Visio.Server.GraphicsServer.VisioGraphicsServiceFault).

I was able to open the document in Visio 2016 and everything looked fine. I compared this file to another, which rendered fine. The difference was very hard to spot: The heading of the tab displayed was italic and not regular as in the good file.

An italic tab name indicates, that this is a background page and not a regular page. After changing the page type, everything worked as expected.

SQL Server 2016 Power Pivot for SharePoint 2016 Health Rules – is not installed

In a SharePoint 2016 Farm with Power pivot health rules will fail with the following error:

Power Pivot: ADOMD.NET is not installed on a standalone WFE that is configured 
for central admin

Trevor Seward  wrote a great article on this topic focusing on SQL 2012. To verify that his article is still valid for SQL Server 2016 and SharePoint 2016 with Power Pivot, I followed his article:

I installed the latest SQL_AS_ADOMD.msi, which can be downloaded here. But nothing changed.

Here is the content of the Microsoft.AnalysisServices.AdomdClient.dll ( found under C:\windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.AnalysisServices.AdomdClient\v4.0_13.0.0.0. ….

[SharePointPermission(System.Security.Permissions.SecurityAction.LinkDemand, ObjectModel = true)]
public override SPHealthCheckStatus Check()
SPHealthCheckStatus result;
if (!HealthUtil.isCentralAdminConfiged())
result = SPHealthCheckStatus.Passed;
if (HealthUtil.IsADOMDInstalled(""))
result = SPHealthCheckStatus.Passed;
result = SPHealthCheckStatus.Failed;

A quick check via Power Shell reveals the following

$connnection = new-object Microsoft.AnalysisServices.AdomdClient.AdomdConnection

The client version is: “13.0.1601.5 ((SQL16_RTM).160429-2226)” and that is why the rule fails.

Either you disable the rule or ignore it, if Adomd is installed properly.