3 Ways to get names and urls for all SharePoint Sites Using Powershell ,Admin Center and Exported csv file

M365 PowerShell PowerShell For SharePoint Online SharePoint Online

In today’s article I will show you how we can get information about the sites we have created in our sharepoint online
What we need is a list with the name of each site and the email address of each one individually
First we need to run the following PowerShell with administrator privileges

# Connect to SharePoint Online
Connect-SPOService -Url "https://mytenant-admin.sharepoint.com"

# Get all the site collections
$sites = Get-SPOSite -Limit All

# Foreach site type  title and URL
foreach ($site in $sites) {
    Write-Output "Site Name: $($site.Title)"
    Write-Output "Site URL: $($site.Url)"


# Disconnect from SharePoint Online

it should be noted that in order to view all the sites we have created in sharepoint we can also view them from the sharepoint admin center under the link Active Sites

But we have another way to export from the sharepoint admin center a csv that will contain information for all our active SharePoint sites

Leave a Reply

Your email address will not be published. Required fields are marked *