SharePoint Online: Find All Communication Sites using PowerShell

Requirement: Get All Communication Sites in SharePoint Online Tenant

How to Find All Communication Site Collections in SharePoint Online?
If you want to get a list of communication sites in SharePoint Online,
  • Login to SharePoint admin center (At: https://tenant-admin.sharepoint.com)
  • Click on Sites >> Active Sites. This gets you all sites in the tenant. Now you can filter sites based on a specific site template, E.g. "Communication Sites". 
    sharepoint online get all communication site collections


SharePoint Online: PowerShell to Get All Communication Sites
Communication sites in SharePoint Online tenant can be quickly listed by filtering sites based on the web template ID "SITEPAGEPUBLISHING#0".
#Parameters
$TenantAdminURL = "https://crescent-admin.sharepoint.com"

#Connect to Tenant Admin Site
Connect-SPOService -url $TenantAdminURL -Credential (Get-Credential)

#Get All Communication Sites
Get-SPOSite -Template SITEPAGEPUBLISHING#0 -Limit ALL
This script lists every modern communication site in the tenant.
powershell to find all communication sites in sharepoint online

PnP PowerShell to Find All Communication Site collections
Similar to the above SharePoint Online Management Shell, The PnP cmdlets also can be used to list all Communication sites:
#Parameters
$TenantAdminURL = "https://crescent-admin.sharepoint.com"

#Connect to Tenant Admin Site
Connect-PnPOnline -url $TenantAdminURL -UseWebLogin

#Get All Communication Sites
Get-PnPTenantSite -Template "SITEPAGEPUBLISHING#0"
SharePoint Online: Find All Communication Sites using PowerShell SharePoint Online: Find All Communication Sites using PowerShell Reviewed by Salaudeen Rajack on April 18, 2019 Rating: 5

No comments:

Please Login and comment to get your questions answered!

Powered by Blogger.