SharePoint Online: How to Hide Default Themes?

Themes are quick way to add branding to SharePoint Online sites. However, we wanted to restrict site owners from changing the themes for uniform look and feel over all sites. Fortunately, SharePoint Online provides a cmdlet to hide default themes and enforce governance.

PowerShell to Hide Default Themes in SharePoint Online:
Open SharePoint Online Management Shell, and run this PowerShell script to hide default themes in SharePoint Online.
#SharePoint Online Admin Center URL
$AdminURL = ""

#Get Credentials to connect
$Cred = Get-Credential

#Connect to SharePoint Online
Connect-SPOService -url $AdminURL -credential $Cred

#Check If Default Themes are hidden already
    Write-Host -f Yellow "Default themes are already hidden!"
    Set-SPOHideDefaultThemes $True
    Write-Host -f Yellow "Default themes are now hidden!"

Now, this is what you get when you click on "Change the Look" from Site Settings menu in modern SharePoint Online sites:

To reverse (Enable all default themes), simply call the "Set-SPOHideDefaultThemes" cmdlet with "$False" parameter.
Set-SPOHideDefaultThemes $False

No comments:

Please Login and comment to get your questions answered!

Powered by Blogger.