How to use SharePoint Online Management Shell

This SharePoint Online tutorial, we will discuss how to use the SharePoint Online management shell to connect to SharePoint Online sites.

We will see how to set up SharePoint 2013 Online Management Shell to connect to SharePoint online sites.

If you directly try to connect to a SharePoint online site from your local SharePoint 2013 management shell, you may receive the below error message.

Connect-SPOService: The term ‘Connect-SPOService’ is not recognized as the name of a cmdlet, function, script file, or operable program.

Download and Install SharePoint Online Management Shell

Follow the below step to set up the environment:

Once SharePoint Online management shell installation is over, search for SharePoint Online Management Shell. This will open your management shell through which you can connect to your SharePoint online sites.

You can run the below command to connect to the SharePoint Online site from SharePoint Online Management Shell.

Connect-SPOService -Url -credential

Here is my SharePoint Online Administration Center.

Once you run the command it will ask you for a password.

Then you can run the Get-SPOSite which will display all your sites.

Connect through Windows PowerShell ISE

You can open your Windows PowerShell ISE in admin mode and can write commands like below:

Import-Module Microsoft.Online.SharePoint.Powershell -Verbose
Connect-SPOService -Url -credential


Then it will display results like below:

how to use SharePoint Online Management Shell

Sometimes if it gives errors like:

Connect-SPOService: The term ‘Connect-SPOService’ is not recognized as the name of a cmdlet, function, script file, or operable program.

You can try writing like below:

Import-Module Microsoft.Online.SharePoint.Powershell -Verbose


Import-Module Microsoft.Online.SharePoint.PowerShell -DisableNameChecking

You may like following SharePoint Online PowerShell tutorials:

This SharePoint tutorial, we learned how to download and install the SharePoint Online management shell, also we saw how to connect to SharePoint Online sites from SharePoint Online management shell.

Donwload Hub site pdf

Download SharePoint Online Tutorial PDF FREE!

Get update on Webinars, video tutorials, training courses etc.

Bhawana Rathore

Hello Everyone!! I am Bhawana a SharePoint MVP and having about 8+ years of SharePoint experience as well as in .Net technologies . I have worked in all the versions of SharePoint from wss to Office 365. I have good exposure in Customization and Migration using Nintex, Metalogix tools . Now exploring more in SharePoint 2016 :) Hope here I can contribute and share my knowledge to the fullest. As I believe "There is no wealth like knowledge, and no poverty like ignorance"