Monday, February 27, 2017

Get SharePoint logs

It is getting old PowerShell script but did need it recently. The script collection log files from all the servers in the farm for a given period.

Tip: $time is the copy/paste value from the SharePoint error message box.

$time = "23-02-2017 11:26:52"
$time = $time.Trim()
$timeToAdd = 10
$startTime = [Datetime]::Parse($time)
$endTime = $startTime.AddSeconds($timeToAdd)
$path = "c:\temp\log $($time.Replace(":", [String]::Empty)).txt"
Merge-SPLogFile -StartTime $startTime -EndTime $endTime -Path $path -Overwrite

Monday, September 19, 2016

Invalid JWT token. Could not resolve issuer token.

For the second time in three years. I have had the pleasure of encounter a "Invalid JWT token. Could not resolve issuer token." Error. The error comes from a provider-hosted add-in which worked fine the day before. The last time I got the error, I ended up recreate my client ID and client secret both in SharePoint online and need to update my web.config. But this year I was keen on finding a solution! After some time to even understand the error message. I found this article "Replace an expiring client secret in a SharePoint Add-in" Article goes step-by-step how to update your client secret. I have updated the script, as I allready knew my add-in name.

#set the name of my add-in
$displayName = "governanceapp"
$appentry = Get-MsolServicePrincipal -all  | ? { $_.DisplayName -eq $displayName}
$principalId = $appentry.AppPrincipalId
$bytes = New-Object Byte[] 32
$rand = [System.Security.Cryptography.RandomNumberGenerator]::Create()
$newClientSecret = [System.Convert]::ToBase64String($bytes)
New-MsolServicePrincipalCredential -AppPrincipalId $principalId -Type Symmetric -Usage Sign -Value $newClientSecret
New-MsolServicePrincipalCredential -AppPrincipalId $principalId -Type Symmetric -Usage Verify -Value $newClientSecret
New-MsolServicePrincipalCredential -AppPrincipalId $principalId -Type Password -Usage Verify -Value $newClientSecret
#this go into the web.config

Saturday, August 27, 2016

New event in the Danish SharePoint community SPBG ERFA omkring SharePoint Framework

A new event in the Danish SharePoint community has been posted on the user group website. Read more about SharePoint Bruger Gruppe (SPBG): Møder at

Thursday, August 25, 2016

SPBG ERFA omkring SharePoint Framework

Hej SharePointer

Kom til SPBG erfa møde onsdag den 21. september, i København, og mød Per Jakobsen. Per er Principal Developer fra ProActive. Per vil give en introduktion til det nye SharePoint Framework og om de nye teknologier som det bygger på. Vi afholder mødet hos KMD fra kl. 17:00 til ca. 19 tiden. S.U den 19. septmenber. Tilmelding sker på

Husk vi flyttet til, se mere her

Friday, June 24, 2016

SPBG Office 365 Dev Camp 2016

Kom til et gratis heldags arrangement omkring udvikling i Office 365 i København den 16. august 2016.

På dagen bliver der givet en introduktion til ASP.NET Core 1.0 og gennemgår Office 365 Dev Patterns & Practices (PnP) ( Kendskab til SharePoint/Office 365 udvikling ikke nødvendig!


  • ASP.NET Core 1.0 introduktion niveau.
  • Hvad er Office 365 Dev Patterns & Practices (PnP) og basis operationer.
  • PnP Timer Job Framework.
  • Authentication Manager.
  • Site Provisioning Framework og PnP PowerShell.

Read more about the event here