Unable connect SPO service

when i key in Connect-SPOService -Url https://abc-admin.sharepoint.com and it appear error below :

Connect-SPOService : The ‘Connect-SPOService’ command was found in the module ‘Microsoft.Online.SharePoint.PowerShell’, but the module could not be loaded. For more information, run ‘Import-Module
Microsoft.Online.SharePoint.PowerShell’.
At line:1 char:1

  • Connect-SPOService -Url https://abc-admin.sharepoint.com
  •   + CategoryInfo          : ObjectNotFound: (Connect-SPOService:String) [], CommandNotFoundException
      + FullyQualifiedErrorId : CouldNotAutoloadMatchingModule
    
    

i was try to key in below code also :
Install-Module -Name Microsoft.Online.SharePoint.PowerShell -Force
Install-Module -Name Microsoft.Online.SharePoint.PowerShell
Import-Module Microsoft.Online.SharePoint.PowerShell
Set-ExecutionPolicy RemoteSigned

But no luck still appear same error .
Then i try to install Sharepoint online management shell and run again connect SPO and i get the same error as well.

Even I using new version powershell (powershell 7) also get same error /.

You don’t show where you ran Import-Module. That should give you a clue as to what is wrong.

1 Like

Dear KRZYDOUG .

It should below error :

What version is that powershell? Run $psversiontable

Jun,
Welcome to the forum. :wave:t3:

Please do not post images of code or error messages. Instead post the plain text formatted as code.

When you post code, sample data, console output or error messages please format it as code using the preformatted text button ( </> ). Simply place your cursor on an empty line, click the button and paste your code.

Thanks in advance

How to format code in PowerShell.org 1 <---- Click :point_up_2:t4: :wink:

( !! Sometimes the preformatted text button hides behind the settings gear symbol. :wink: )

Testing Account 1,
Welcome to the forum. :wave:t3:

Please do not post images of code or error messages. Instead post the plain text formatted as code.

When you post code, sample data, console output or error messages please format it as code using the preformatted text button ( </> ). Simply place your cursor on an empty line, click the button and paste your code.

Thanks in advance

How to format code in PowerShell.org 1 <---- Click :point_up_2:t4: :wink:

( !! Sometimes the preformatted text button hides behind the settings gear symbol. :wink: )