This category contains my articles that, in one way or another, include the usage of PowerShell. That’s a lot of posts – such a large share of what I write about contains different configuration steps, and those are most often easiest to do with PowerShell.
While most of the time there’s a configuration option available using the GUI as well, creating a reusable and debuggable script is generally speaking the preferred option for me.
But what is PowerShell, exactly? If you’re reading this blog, you probably already know I’m not the biggest fan of reinventing the wheel – so I’m not going to reinvent the definition, either. The following is adapted from Microsoft’s documentation for PowerShell:
Windows PowerShell (PowerShell, or PoSh for short) is a Windows command-line shell that includes an interactive prompt and a scripting environment that can be used independently or in combination.
Unlike most shells, which accept and return text, Windows PowerShell is built on top of the .NET Framework common language runtime (CLR) and the .NET Framework, and accepts and returns .NET Framework objects. This makes it a powerful tool for most configuration and automation tasks.
Windows PowerShell introduces the concept of a cmdlet (pronounced “command-let”), a simple, single-function command-line tool built into the shell. You can use each cmdlet separately, but their power is realized when you use these simple tools in combination to perform complex tasks. Straight out of the box there’s over a hundred basic core cmdlets, and you can write your own cmdlets and share them with other users.
The Power of PowerShell certainly does NOT come from the environment itself or the built-in commandlets – not at all. It comes from the hugely useful modules written and published by vendors and community. The ones I mostly use are probably the modules for Azure, SharePoint, Exchange and PnP commandlets.
A quick heads-up – if you remove the root site (or RootWeb, like it’s called in the code) of your classic SharePoint Site Collection, that’s going to cause you some grey hairs. It might even, in some rare cases, be unrecoverable! The following post describes what kind of issues you…Continue reading Don’t remove the root web of your classic SharePoint Site Collection!
Every now and then, you will run into a situation, where you will need to somehow dump the console output (or transcript) of running a console application. I’m actually going to argue it happens a lot more often than one would think – in my case, any time a customer…Continue reading How to output console or PowerShell transcript to a file in Windows
This blog post 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 the ones below: Connect-PnPOnline : The term ‘Connect-PnPOnline’ is…Continue reading How to solve errors about missing PnP Cmdlets on PowerShell
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…Continue reading Fixing the “For security reasons DTD is prohibited in this XML document.” issue
This post describes the actual, working, and the 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 perhaps…Continue reading Remove-SPODeletedSite – Actually removing a SharePoint Online Site Collection
This post describes a peculiar problem that a customer had. In their intranet, all of their employees had a managed metadata -typed managed property in SharePoint User Profile Service and a mapping from that property to RefinableString31. RefinableString31, in turn, was used on Search DisplayTemplates to show the textual value…Continue reading RefinableString -managed property in SharePoint Online not populating for all items