connect-sposervice the term ‘connect-sposervice’ is not recognized as the name of a cmdlet

This SharePoint tutorial explains, how to fix error connect-sposervice the term ‘connect-sposervice’ is not recognized as the name of a cmdlet PowerShell SharePoint. The error comes while running the Connect-SPOService cmdlet.

connect-sposervice the term ‘connect-sposervice’ is not recognized

Recently, while working with SharePoint Online to add a new theme in SharePoint Online using PowerShell, I got the error.

Connect-SPOService -Url https://tsinfo-admin.sharepoint.com/ -credential Bijay@tsinfo.onmicrosoft.com

I got an error which says:

connect-sposervice the term ‘connect-sposervice’ is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1

  • Connect-SPOService -Url https://tsinfo.sharepoint.com/ -credential De …
  • ~~~~~~
    • CategoryInfo : ObjectNotFound: (Connect-SPOService:String) [], CommandNotFoundException
    • FullyQualifiedErrorId : CommandNotFoundException

I was also writing the below PowerShell script to add the custom theme to the SharePoint Online site.

Add-SPOTheme -Name $themeName -Palette $palette -IsInverted:$false -Overwrite

Add-SPOTheme: The term ‘Add-SPOTheme’ is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of
the name, or if a path was included, verify that the path is correct and try again.
At line:30 char:1

  • Add-SPOTheme -Name $themeName -Palette $palette -IsInverted:$false -O …
  • ~~~~
    • CategoryInfo : ObjectNotFound: (Add-SPOTheme:String) [], CommandNotFoundException
    • FullyQualifiedErrorId : CommandNotFoundException: The term ” is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path
      was included, verify that the path is correct, and try again.
      At line:31 char:1
  • ~
    • CategoryInfo : ObjectNotFound: (:String) [], CommandNotFoundException
    • FullyQualifiedErrorId : CommandNotFoundException
connect-sposervice the term 'connect-sposervice' is not recognized
connect-sposervice the term connect-sposervice is not recognized

The error was coming because SharePoint Online Management Shell is not installed in our local system.

Below is the code to check whether SharePoint Online Management Shell is available in our local system or not:-

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

If the SharePoint Online management shell is not installed, then you can run the below command to install the latest version of SharePoint Online management shell.

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

You may like following PowerShell tutorials:

Here, we learned how to fix error connect-sposervice the term ‘connect-sposervice’ is not recognized as the name of a cmdlet.

  • Did you install the below command and check if the SharePoint online management shell is installed or not?

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

    If not installed, you can run the below command:
    Install-Module -Name Microsoft.Online.SharePoint.PowerShell

    • Hi! On the off chance you get a notification for the resurrection of this question …

      I’m experiencing the exact problem you’ve detailed, but I actually am running the SP Online Mgmt Shell. When I run the command you listed, the return is:

      Microsoft.Online.SharePoint.PowerShell 16.0.22810.12000
      Microsoft.Online.SharePoint.PowerShell 16.0.22713.12000
      Microsoft.Online.SharePoint.PowerShell 16.0.22713.12000
      Microsoft.Online.SharePoint.PowerShell 16.0.22713.0

      Many responses to this problem all say the same thing you’ve said, which is great advice, but in my case I actually am running the module, so I’m stumped. Any advice? Much appreciated!

  • >