November 19, 2015

View Visual Studio Online build status on your Microsoft Band

I’ve been very happy with my Microsoft Band and eagerly waiting for the Band 2 to arrive. I’ve used my Band 24/7 now for 6 months, and it has worked quite well for fitness and sleep tracking. However, I’ve tried to figure out good uses for the Band at work.

Time flies, and past two years I’ve been concentrating on product development of a smashing Market Intelligence application for SharePoint, and with that we’ve doing Continuous Integration, in our current case meaning nightly builds. Every night the SharePoint application is removed from the server, and fetched, re-build, and installed using PowerShell scripts. Finally some tests cases are run towards the fresh installation to catch possible issues that are not installation related.

Now, I can of course order email notifications of failed builds (those do occur, believe it or not), but email is old skool, why not receive the build notifications somewhere else?

As you might have guessed, I use Microsoft Band for that. I have a nice Web Tile on Band showing the current status, but it will also notify me of the status when it changes.

How to do it

  1. Go to Band Web Tile wizard at and click “Get Started”
  2. Select “Single page tile” and “Scrolling text wrap” and click Next
  3. Go to your Visual Studio Online (new name is Visual Studio Team Services) build definition, and General tab

  4. Select “Badge enabled”, and click the “Show url…”
  5. Copy URL to clipboard and paste the URL to step 2 in Web Tile wizard and click Next

  6. Drag and drop the text fields as you desire, important is to have the succeeded/failed text somewhere and click Next
  7. Set up notifications as you wish, in my case it will notify me of failed builds only, then click Next.
  8. On the next step, name your Web Tile, and upload a picture, then click Next
  9. Finally, download the generated .webtile to your computer, and upload it to your mobile device either via E-mail, or via OneDrive/Google Drive, etc.
  10. Open the .webtile on your mobile device, and it should start Microsoft Health app, and ask your confirmation to save it
  11. View your build status like a boss!


September 17, 2015

Yammer Inbox: Mark All as Read


Cannot “mark all as read” in Yammer inbox.


Took Nate Haug’s script here, and modified it slightly to work with current version of Yammer. You need to execute the following script in Chrome or Firefox (Firebug) / Safari JavaScript console:
  1. Press F1 to open developer tools
  2. Select Console
  3. Paste in the following code and press Enter (after script has finished, restart browser).
var yamTime = 1000;
var goBack = function() {
    setTimeout(clickLink, yamTime);
var clickLink = function() {
  var $element = jQuery('.yj-inbox-list--messages li:first a');
  var $moreLink = jQuery('#moreButton button');
  if ($element.length) {
    setTimeout(goBack, yamTime);
  else if ($moreLink.length) {
    setTimeout(clickLink, yamTime);

NOTE! If you have slow connection you might run into errors when Inbox doesn’t have time to refresh properly and you’re stuck in a loop with one same item, please increase yamTime value.

NOTE! You might need to run the script few times, and click the “More items” link on Yammer page to show rest of the items.


No worries, real solution is just around the corner:

June 9, 2015

SharePoint: Create Publishing page with specific Modified date using PowerShell


I had to import thousands of lines from CSV file and turn those into SharePoint publishing pages. Overall, it was easy with PowerShell, but whenever I used $item.File.Publish("") at the end of creating new Publishing Page to publish it, the Modified date was set to current date and time. I tried all possible variations and tricks I could come up with until I came up with the solution.


You need to turn off minor versioning for the Pages list and only call CheckIn for the individual items. Doing CheckIn doesn't touch the Modified date. After you've imported all items, you can enable minor versioning on the list, and all items will remain published.

$ver = $host | select version
if ($ver.Version.Major -gt 1)  {$Host.Runspace.ThreadOptions = "ReuseThread"}
Add-PsSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
Import-Module WebAdministration -ErrorAction SilentlyContinue

$web = Get-SPWeb
$list = $web.Lists["Pages"]

#Important to disable this first to get rid of
$list.EnableMinorVersions = $false
$list.EnableVersioning = $false

# Change it to real layout name
$PageLayout =  $pweb.GetAvailablePageLayouts() | Where-Object {$_.ServerRelativeUrl -eq "/m/nf/_catalogs/masterpage/myportal/article.aspx"}

# Imports modified Rawdata from CSV file to MiPages - change filename if needed
Import-Csv -Delimiter ";" -Path (Resolve-Path RawData.csv) | ForEach-Object {
    # Page title
    $PageTitle = $_.Title
    # Place to save news, filename format is i+ID.aspx
    $PageUrl = "i" + [string]$_.ID + ".aspx"
    $SourceDate = Get-Date $_.Date

    Write-Host "Creating $($PageUrl)"

    # Create blank page
    $page = $pWeb.AddPublishingPage($PageUrl,$PageLayout)
    # Sets listitem fields
    $item = $page.ListItem
    $item["Title"] = $PageTitle
    $item["Created"] = $SourceDate
    $item["Modified"] = $SourceDate

    # Update list items

    # Check-in and publish page  

$list.EnableMinorVersions = $true
$list.EnableVersioning = $true

May 20, 2015

Media Center Status Application goes open source

Windows Media Center Status Application I mainly developed during the early stages of Windows Vista (also supports 7 and 8) is now open source. It was originally developed for my own use, but I soon realized there were hundreds if not thousands of Media Center users out there who wanted to share their media viewing preferences in social media, such as Facebook and Twitter.

During the evolution of the application many nice features were added, such as getting notifications of tweets of people you follow inside Media Center. It didn't take long until someone requested a way to filter out what items are published to Facebook wall (as it was called back then), so I also added RegEx filter to filter out specific media titles from getting sent out - if one had automatic publishing enabled.

There was also ambitious monetization ideas when I added feature that fetched media images (such as DVD and CD covers) from Amazon to show in the Facebook status update. I always knew that the user base for the application wasn't that huge and wasn't too surprised I didn't end up getting a dime from Amazon referrals. But I did get few hits so it proved it was working.

Otherwise monetization relied on donations, and I was surprised that I indeed got two donations totalling €25. That was €25 more than I was expecting, so thank you Marc Stride and Graham Evans. I'd like to think I bought beer with that money and enjoyed it on a sunny summer evening, but probably I just bought cement or boards for the house construction.

I got the idea for the application once during Microsoft's MSDN conference where I decided not to participate in the boring directly work related enterprise sessions, but instead go off-the-beaten-path. I learned so much not only about Media Center, but also on Robotics Studio. The next few evenings I spent at the hotel programming this application.

Biggest challenge was by no doubt the ever changing APIs of Facebook, Twitter. First the Facebook walls were gone and Graph API was introduced, then Twitter did lot of changes in authentication. Media Center development was the only one that didn't receive any major changes since Vista, unfortunately.

I was considering open sourcing it for a long time, but just didn't get to it, but hey, better later than never.

You can find bits at

Compiled app, changelog and other details are still at

March 4, 2015

Sync any folder to OneDrive without moving it to local OneDrive folder


I’ve been using c:\work folder forever to store my work related semi-temporary files on my laptop hard drive. Although losing contents of that file due to hard drive issue or similar wouldn’t cause much downtime in my work (as all important files are stored in SharePoint Online), I still didn’t feel too relaxed with the possibility of losing even 5 minutes of work in case that folder somehow disappeared.

Few times I’ve decided to move my c:\work to OneDrive for Business folder in order to sync work related files automatically to business version of OneDrive hosted in Office 365. However, each time I’ve got frustrated by the fact that finding the OneDrive folder in File Explorer is so difficult. Sure, using Favorites or Quick Access (as in Windows 10), I can get there pretty easily, but still, it will add at least one additional folder level and lots of clikety clicks with my tired little mouse to get where I want to go. Plus, just looking at the left pane in File Explorer that is so full with garbage (several instances of OneDrive, DLNA devices just below This PC, Libraries, Control Panel?!, yet again same libraries, Desktop items at the root, etc.) makes me want to cry.


Use junction points to direct content from c:\work into your OneDrive folder, such as C:\Users\Jussi\OneDrive - Sulava Oy\Work. After creating junction point such as this, all content you add to c:\work will actually reside in the OneDrive folder, and are synced to OneDrive normally. And best of all, I can still use c:\work like I’ve always used.

Steps how to do this:

  1. Rename your existing c:\work (or whatever your folder is called) to e.g., c:\work_old
  2. Create Work folder into the OneDrive folder, e.g., C:\Users\Jussi\OneDrive - Sulava Oy\Work
  3. Open Command Prompt
  4. Type in mklink /j c:\Work "C:\Users\Jussi\OneDrive - Sulava Oy\Work"
  5. Move old content from c:\work_old to c:\work and confirm that Work folder under OneDrive folder starts syncing and eventually goes green

NOTE! As there is really just one instance of files on your hard drive, if you remove folder under OneDrive folder, it will also be removed from the junction point location.

January 27, 2015

Office365 PowerBI error: ‘oops, something went wrong’


Opening Office 365 PowerBI reports in a browser doesn’t work for some users. Instead of a working report, they get error “oops, something went wrong”, followed by descriptive error “[object Object]”. Error is raised from infonav.min.js.

Issue occurs on some users, regardless of what browser they are using. For some users it occurs only on IE, but not on Chrome.



Further investigation showed that the issue is due to users having increased the text size in Windows. With Chrome, you can use all text sizes except the largest one. With Internet Explorer, only the smallest text size works.

Please note that number of steps on the slider might differ depending on the resolution of your screen. If in doubt, go for the Smaller end, and increase one step at a time to find our the breaking point in your configuration.


December 11, 2014

SharePoint injects garbage at the end of Page Layout


I upload custom Page Layouts to SharePoint 2013 using CSOM and PowerShell. Uploading a page layout file and configuring it is fairly straightforward, but when creating a new publishing page using the uploaded page layout, and attempting to view the page, you get error:

Sorry, something went wrong
Only Content controls are allowed directly in a content page that contains Content controls.


Looking at the Page Layout file in SharePoint Designer, you see that there are indeed strange lines of code appended at the end of the file, outside Content controls, see lines 27-34 in picture below.


For some reason SharePoint has injected elements such as SharePointWebControls:ctfieldrefs, mso:CustomDocumentProperties, meta name="WebPartPageExpansion", SharePoint:CTFieldRefs but why? This issue only occurs on custom page layouts, with any default page layout you cannot reproduce the issue.


As you can see from the SPD picture above, you get the issue also with a very simple page layout, where you’ve basically stripped away everything custom. But wait, look at the <asp:content> nodes, notice how content is with lower case, and not Content.


Having asp:content with lower case will mess up SharePoint and it will inject strange lines at the end of your custom page layout. Replace them with asp:Content and issue no longer occurs.