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

List over available languages for a site in SharePoint Online

From time to time it is necessary to set the LCID or language code for creating new resources like sites. Even if more and more resources get multi-language support, it is usually be required to set the default language for fallback. DisplayNameLanguageTagLcid Arabicar-SA1025 Azerbaijaniaz-Latn-AZ1068 Basqueeu-ES1069 Bosnian (Latin)bs-Latn-BA5146 Bulgarianbg-BG1026 Catalanca-ES1027 Chinese (Simplified)zh-CN2052 Chinese (Traditional)zh-TW1028 Croatianhr-HR1050 Czechcs-CZ1029 … Continue reading List over available languages for a site in SharePoint Online

Help! My Azure WebJob, Azure Function or Azure Automation job has stopped working with “Token request failed”

I work a lot with automation of tasks in Microsoft 365 and Azure, and many of them involve connecting to other Microsoft 365 services like SharePoint Online. Years back Azure WebJob was the only viable solution for running automated .NET and PowerShell based tasks, but over the years this has moved along to Azure Functions, … Continue reading Help! My Azure WebJob, Azure Function or Azure Automation job has stopped working with “Token request failed”

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