Tuesday, 12 June 2018

Powershell : The term 'Connect-SPOService' is not recognized as the name of a cmdlet

Problem :

I have got the error message "The term 'Connect-SPOService' is not recognized as the name of a cmdlet" when I run the powershell cmdlet Connect-SPOService to connect SharePoint Online site.
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://conotoso-admin.sharepoint.com
+ ~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Connect-SPOService:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

Solution :

The command Connect-SPOService belongs to SharePoint Online Management Shell, so before using this command we need to install the SPO Management Shell and import the module. You only need install once for each computer from which you are running SPO Powershell commands.

Install SharePoint Online Management Shell:

You can download and install the setup from this path : Download SharePoint Online Management Shell

Connect SharePoint Online Module:

Once you have installed the above setup, run the following command to import the SharePoint online powershell module.
Import-Module Microsoft.Online.SharePoint.Powershell
Then run the following commands to connect spo service and list all sites.
Connect-SPOService -url https://conotoso-admin.sharepoint.com 
Get-SPOSite | Select Title, Url


No comments:

Post a Comment