First, we can check if you have already installed the SharePoint Online Management Shell by running the following command in an administrative mode in PowerShell:

Get-Module -Name Microsoft.Online.SharePoint.PowerShell -ListAvailable | Select Name,Version

If your operating system is using PowerShell 5 or newer, you can also install the SharePoint Online Management Shell by running the following command in administrative mode:

Install-Module -Name Microsoft.Online.SharePoint.PowerShell

If you don’t have administrative privileges on the system, you can install the SharePoint Online Management Shell only for the current user by running the following command:

Install-Module -Name Microsoft.Online.SharePoint.PowerShell -Scope CurrentUser

To ensure you have all available cmdlets, you should always make sure the module is up to date. You can update the SharePoint Online Management Shell by running the following command in administrative mode:

Update-Module -Name Microsoft.Online.SharePoint.PowerShell

To connect with a user name and password

  1. Run the following command at the SharePoint Online Management Shell command prompt:

Connect-SPOService -Url https://abcde-admin.sharepoint.com -Credential admin@abcde.com

  • When prompted with the Windows PowerShell credential request dialog box, type the password for the SharePoint admin account.


$themepalette = @{
"themePrimary" = "#0a4d80";
"themeLighterAlt" = "#f1f6fa";
"themeLighter" = "#c8dceb";
"themeLight" = "#9dbfd9";
"themeTertiary" = "#5088b3";
"themeSecondary" = "#1b5d8f";
"themeDarkAlt" = "#094573";
"themeDark" = "#083a61";
"themeDarker" = "#062b47";
"neutralLighterAlt" = "#f8f8f8";
"neutralLighter" = "#f4f4f4";
"neutralLight" = "#eaeaea";
"neutralQuaternaryAlt" = "#dadada";
"neutralQuaternary" = "#d0d0d0";
"neutralTertiaryAlt" = "#c8c8c8";
"neutralTertiary" = "#a19f9d";
"neutralSecondary" = "#605e5c";
"neutralSecondaryAlt" = "#8a8886";
"neutralPrimaryAlt" = "#3b3a39";
"neutralPrimary" = "#323130";
"neutralDark" = "#201f1e";
"black" = "#000000";
"white" = "#ffffff";
}

Creates a new custom theme

Add-SPOTheme -Identity "Test Blue Theme" -Palette $themepalette  -IsInverted $false -Overwrite

cmdlet hides the default themes.

Set-SPOHideDefaultThemes $true
cmdlet restores the default themes to the theme picker list.
Set-SPOHideDefaultThemes $false

Advertisement