Don’t remove the root site of your classic SharePoint Site Collection!

Let me explain SharePoint

A quick heads-up – if you remove the root site of your classic SharePoint Site Collection, that site’s going to be troublesome to deal with. Whereas you can always restore a normal site from the site collection recycle bin, the root site you can’t. You actually can’t access the recycle bin after removing the root site, nor can you make magic happen with PowerShell commandlets anymore.

Site Collection Recycle Bin

Site Collection Recycle Bin – where you could access it, if you still had your site!

The Recycle Bin would be located at a url like this: https://<yoursite>/_layouts/15/AdminRecycleBin.aspx, but after the site is removed, it won’t be there. 

If you actually just wanted to get rid of your site collection by removing the site (see below), you’re out of luck again. Even that didn’t happen, as you now still have the site collection, just without any sites in it. You can’t even reuse the url for anything, as it’s still reserved for your site collection! Continue reading

How to output console or PowerShell transcript to a file in Windows

Console output copypaste

Every now and then, you run into a situation, where you’ll need to somehow output the transcript of a console app run. I’m actually going to argue it happens a lot more often than one would think – in my case, any time a customer requires a webjob or a function, that one would normally deploy to Azure, being ran on the servers of the customer.

Problem

Something breaks or the app crashes, and the error is logged to event log… But just the error, not the whole transcript. You’d like to get it all, to figure out what’s actually going on, but event log is not the way to go.

What to do?

Solution: redirect the output directly to a file

Continue reading

How to fix “- – the web site does not support SharePoint Online credentials. The response status code is ‘Unauthorized'” error

SharePoint is not broken - it just does't work

While running some SharePoint Online -PowerShell commandlets, or connecting to a SharePoint Online site from your app, you get a following (or similar) error about your SharePoint Online credentials being unauthorized for something you should definitely be authorized to do:

And that’s not all – by digging into the full error message, you find the underlying internal error:

What awakens my curiosity, is this line:

However, when you open your browser, you can actually log in without a hitch. If that’s the case, this might be a weird internal error in SharePoint Online – doesn’t matter, there’s a hazy and weird, but simple fix!  Continue reading

How to solve errors about missing PnP Cmdlets on PowerShell

SharePoint PnP logo

This blog posts briefly describes how to solve some of the most typical errors about missing PnP Cmdlets when using Windows Powershell (or SharePoint Online Management Shell).

Symptoms

When trying to run some PnP-related cmdlet, you get an error similar to ones below:

Usually, this is luckily a simple fix!  Continue reading

Fixing the “For security reasons DTD is prohibited in this XML document.” issue

"For security reasons DTD is prohibited in this XML document. To enable DTD processing set the ProhibitDtd property on XmlReaderSettings to false and pass the settings into XmlReader.Create method."

This post describes a couple of ways to fix the issue “For security reasons DTD is prohibited in this XML document”. At least for me, it appeared when trying to access SharePoint Online using Powershell or a console program using OfficeDev.PnP (which in turn uses CSOM).

Error

When running any piece of code, whether in PowerShell, .exe console or anything else than in the code behind relies on .NET Framework, you get an error like this:

Continue reading

Unorthodox configuration: How to use VLK and Click-to-run Office Apps side-by-side (Visio and Office 2016 as an example)

Ever had issues with different versions of Office programs not living in harmony together? Me too! This post describes how I was able to fix the issue and get Visio and Office 2016 of different installation types to play well together.

Preface

This blog post was inspired by my need to have Office 365 ProPlus (2016 versions) and Visio running side-by-side on my laptop. That turned out to be a lot more complicated than it arguably should be, so I documented the steps for further use. These instructions are written for that particular scenario (installing MS Visio on a machine with pre-existing Office 2016/365 ProPlus installation). My laptop is running Windows 10 Enterprise, which probably caused one of the issues I ran into.

Let’s get started!  Continue reading

Getting Connect-MsolService (and other SharePoint Online cmdlets) to work

Connect-MsolService

In this post, I’ll try to archive everything you need to download and install to get commandlets like Connect-MsolService working. I’ve had to do it a couple of times when changing laptops, so it’s good to document them somewhere! 🙂

I’ll try to even keep this updated as things change.

Required installations:

  1. Microsoft Online Services Sign-In Assistant for IT Professionals RTW
    1. https://www.microsoft.com/en-us/download/details.aspx?id=28177
  2. SharePoint Online Management Shell
    1. https://www.microsoft.com/en-us/download/details.aspx?id=35588
  3. Windows Azure Active Directory Module for Windows PowerShell (v1)
    1. http://connect.microsoft.com/site1164/Downloads/DownloadDetails.aspx?DownloadID=59185 
      1. Update 5.3.2018: Microsoft actually moved this documentation, and apparently hid it behind authentication somewhere (might require Global Admin or similar on your tenant to even READ IT… That’s smart.)
      2. If you installed it before, it’ll still work, but if you didn’t, never mind. Just see this step.

Now, to run cmdlets like “Connect-MsolService”, just start SharePoint Online Management Shell (or PowerShell).

If you also need Azure Remote Management (AzureRM) cmdlets (I always do!), run this in an elevated PowerShell:

What to do if Microsoft hid the AAD module for PowerShell?

Fear not – only the last step (step 3) changed! Instead of installing the AAD module, you run this on PowerShell: Continue reading

Remove-SPODeletedSite – Actually removing a SharePoint Online Site Collection

Delete site collection

This post describes the actual, working and fast process of removing a site collection in SharePoint Online using the Remove-SPODeletedSite commandlet in SharePoint Online Management Shell (a flavor of PowerShell).

Description

Sometimes you need to get rid of a site collection you’ve created in SharePoint Online. The most typical example perhap being removing the team site created for a group of people working together. That’s pretty simple and there are a few ways of doing that. For example, you might just go ahead, and delete the site from Site Settings (see below).

"Delete this site" on SharePoint Online

“Delete this site” on SharePoint Online – by the way, never use this, if there’s even a 1% you might want your data back! You might never get it.

Or maybe you’re a smart admin, and you go and remove it from the SharePoint Administration (below). Continue reading

Fixing “Connect-SPOService : Identity Client Runtime Library (IDCRL) could not look up the realm information for a federated sign-in.” -error

IDCRL error in PowerShell

Symptoms

While running your SharePoint Online Management Shell scripts (yeah – PowerShell -scripts against the cloud) you can’t get anything done but instead fail at connecting to the SharePoint Online with the following error message:

Just for a handy reminder, this is the syntax of the cmdlet:

(From http://technet.microsoft.com/en-us/library/fp161392.aspx)

Continue reading