Connect-SPOService

Hi! PowerShell newbie here. I do not have the Connect-SPOService cmdlet. I don’t know how to get it. The version of PowerShell I am running:

Name Value


PSVersion 5.1.22621.2506
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
BuildVersion 10.0.22621.2506
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1

The SharePoint module:

Version Name Repository Description


16.0.24… Microsoft.Online.SharePoint.Powe… PSGallery Microsoft SharePoint Online Services Module for Windows PowerShell

Why doesn’t Connect-SPOService work? When I run it, I get this error:

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
  •   + CategoryInfo          : ObjectNotFound: (Connect-SPOService:String) [], CommandNotFoundException
      + FullyQualifiedErrorId : CommandNotFoundException
      
    

I saw in a similar post where one of the suggestions was to run Import-Module. When I do, I get this prompt:

PS C:\Windows\system32> Import-Module
cmdlet Import-Module at command pipeline position 1
Supply values for the following parameters:
Name[0]:

What do I do? I’m trying to connect to a SharePoint library, but I get an error that says “Connection Error: Exception calling “ExecuteQuery” with “0” argument(s): “Identity Client Runtime Library (IDCRL) did not get a response from the Login server.””

I have a feeling I get this error because I can’t connect to SharePoint and I can’t connect to SharePoint without Connect-SPOService. Am I totally off base here?

The Skipper!,
Welcome to the forum. :wave:t3:

So you should start reading:

You should read the topic completely and also follow the links contained in this help topic.

In order to use a command from a powershell module that isn’t installed on a system, you need to install it:

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

If running as an admin, this should work. If not

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

should do the trick.

Once you do that, should be able to run the command.

Most modules install in a place to where the commands will automatically be discoverable and thus, importing the module is not necessary. However, if you do need to Import it, it’s

Import-Module Microsoft.Online.SharePoint.PowerShell

As Olaf mentioned though, this stuff is all on the docs and will show up with some google searches.