In 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.
Subscribe to Our YouTube Channel for more free videos
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:
- First, download and install the Windows Management Framework 3.0.
- Then download and install the SharePoint Online Management Shell.
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 https://onlysharepoint2013-admin.sharepoint.com/ -credential [email protected]
Here https://onlysharepoint2013-admin.sharepoint.com/ 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 https://onlysharepoint2013-admin.sharepoint.com/ -credential [email protected]
Get-SPOSite
Then it will display results like below:
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
or
Import-Module Microsoft.Online.SharePoint.PowerShell -DisableNameChecking
You may like the following SharePoint Online PowerShell tutorials:
- PowerShell read all files from folder and subfolder
- How to upload files to SharePoint using PowerShell
- How to get file modification time and date using PowerShell
- Delete content type from SharePoint list using PowerShell
- How to perform IIS backup and restore using PowerShell
- How to deploy WSP Solution in SharePoint using PowerShell
- How to get SharePoint features using PowerShell
- How to get all SharePoint users and groups using PowerShell
In 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.
Bhawana Rathore is a Microsoft MVP (3 times in Office Apps & Services) and a passionate SharePoint Consultant, having around 10 years of IT experience in the industry, as well as in .Net technologies. She likes to share her technical expertise in EnjoySharePoint.com and SPGuides.com