Export all SharePoint Online Sites using PowerShell

How to extract all sites using the SharePoint Online Management shell cmdlet Get-SPOSite. ?

Before proceed Install the SharePoint Online Management Shell:

a. Download SharePoint Online Management Shell
b. Run the installer
c. Once you have installed the downloaded setup, run the below command to load this module

Note: If powershell console already opened, close and open the powershell again after installing the above setup.

We need admin site url to connect SharePoint Online service, you can refer this post to Get SharePoint Online Admin Site Url. Once you got the admin site url run the below script after replacing your AdminUrl to list all sites.



If you want to retrieve all the available properties, run the below command, it will list all the attributes of first site.

You can also filter the sites based on any available property, the below command lists only sites with sharing capability enabled as ExternalUserSharingOnly.

Run the below command to list sites with share capability disabled.

Export all SharePoint Online Sites to CSV

Run the below command to export all the required details of spo sites to csv file.