How to Install and Connect SharePoint Online PowerShell Module

SharePoint Online team focusing on Microsoft Graph API to provide a common API experience for Office 365 users, but for some Admin-related activities still we need to use the PowerShell module. Follow the below steps to install and connect SharePoint Management Shell.

Import-Module Microsoft.Online.SharePoint.PowerShell -DisableNameChecking
Note: If the PowerShell console is already opened, close and open the PowerShell again after installing the above setup.
  • Now run the following command after replacing your tenant name to connect SPO service. Actually, you have to set your SPO admin site URL, you can refer to this post for more info: how to get SharePoint Online Admin Site Url
Connect-SPOService -url "https://<your tenant name>-admin.sharepoint.com"
  • Once you have connected the SPO service, then you can run SPO management commands. The below command lists all SPO sites.
Get-SPOSite | Select Title, Url

Advertisement