Fix broken Hub Sites in SharePoint Online

If you have been an early adopter of the Hub Site functionality (https://docs.microsoft.com/en-us/sharepoint/planning-hub-sites) in SharePoint Online, you might also get stuck in some trouble with Hub Sites not showing up in SharePoint Admin Center or being unable to register or unregister these sites. Fortunately it is quite easy to clean up broken hub sites and … Continue reading Fix broken Hub Sites in SharePoint Online

Create a Communication Site from code in SharePoint Online using PowerShell

Lately Microsoft released the new  and long awaited modern site template for publishing sites in SharePoint Online (Office 365). The site templates is named "Communication Site" and is the second template released after the modern "Team Site". This site template can be created if you have permissions from the SharePoint Home page using the "Create … Continue reading Create a Communication Site from code in SharePoint Online using PowerShell

Problem with connecting to SharePoint Online in Office 365 with PowerShell, SharePoint Designer and other 3. party tools

You are not any longer able to log into SharePoint using PowerShell, SharePoint Designer and other 3. party tools (ex. ShareGate, SharePoint Search Query Tool etc). The error message states something that you are "Unauthorized" and "…the web site does not support SharePoint Online credentials" even though you username and password is fine. Example: Error … Continue reading Problem with connecting to SharePoint Online in Office 365 with PowerShell, SharePoint Designer and other 3. party tools

Create list from custom template in SharePoint with PowerShell

This examples shows how to create new lists from custom list templates in SharePoint using PowerShell and CSOM. Custom list templates are STP-files uploaded to the List Template Gallery on the site. This should work both on-premises (2013/2016) and Online (Office 365). https://gist.github.com/aflyen/da04a090cae03ae4db58589fe2246716 Note: This example uses commands from the Office Dev PnP PowerShell library, ex. "Connect-PnPContext". I … Continue reading Create list from custom template in SharePoint with PowerShell

Enable ratings in SharePoint with PowerShell and CSOM

In document libraries it is possible to enable ratings, both likes and average score (1-5). In this article I will cover how to enable "Likes" on the Pages library in a publishing site. When configuring libraries manually, this is enabled from the "Rating settings" in the library: But when we follow the remote provisioning pattern to create new … Continue reading Enable ratings in SharePoint with PowerShell and CSOM

Add AD security group as Site Collection administrator with PowerShell in SharePoint

In provisioning solutions it can be a good practice to add a security group from Active Directory as an additional site collection owner. Unfortunately a security group is not accepted as either primary or secondary owner. So to set a group as site collection administrator, the easiest approach I could find was to set the "IsSiteAdmin" … Continue reading Add AD security group as Site Collection administrator with PowerShell in SharePoint

Enabling scheduling on Publishing Pages in SharePoint Online (Office 365) using CSOM and PowerShell

Scheduling is easily enabled through the web interface when configuring the "Pages" library, but when deploying solutions using PowerShell, this must be automated as part of the configuration. Unfortunately, as many other sources also state, this is not directly supported in the Client Side API (CSOM). The solution is to manually set up the Pages … Continue reading Enabling scheduling on Publishing Pages in SharePoint Online (Office 365) using CSOM and PowerShell

Exporting XsltListViewWebPart in SharePoint 2013

By default the XsltListViewWebPart does not support export from the web user interface. I often build solutions by configuring the web parts in the browers, exporting and adjusting the defintions and then deploying them with PowerShell. With a few lines of PowerShell this capability can also be enabled for the Xslt List View Web Part. Before enabling the … Continue reading Exporting XsltListViewWebPart in SharePoint 2013

Using BCS from PowerShell with SharePoint 2013

Running data migrations with SharePoint 2013 often involves using BCS and PowerShell if you don't have and third party tools at hand. This can be a bit tricky to set up, but once you are familiar the the BCS configuration, the PowerShell scripts are mostly straight forward. From my experience there are a few differences … Continue reading Using BCS from PowerShell with SharePoint 2013

Use PowerShell to create a demosite for all the common used Web Templates in SharePoint 2013

In my previous article I provided a list of all the common used web templates in SharePoint 2013. For demo purposes it can be handy to spin up a copy of all these templates and later easy remove them. Using PowerShell we can accomplish this with the snippets provided below. Change the parameters under "Configuration" to match … Continue reading Use PowerShell to create a demosite for all the common used Web Templates in SharePoint 2013