In this post, we’ll Get All Site Collections and SubSites Per Farm.
Addiotnaly, we’ll explore the following:
- 1 SharePoint Site Collections and Subsites
- 2 Site Collections List Per Farm
- 3 Site Collections List Per Web Application
- 4 Site Collections List Per Content Database
- 5 Get Current Site Collection Size
- 6 Web Sites List Per Web Application
- 7 Web Sites List Per Site Collection
- 8 Web Application Vs Content Database Vs Site Collection Vs SubSites
- 9 PowerShell Script to get all Site Collections and Subsites details Per SharePoint farm
- 10 SharePoint Farm Scan Report
You may also like to check the full “SharePoint Farm Scan Report” PowerShell Script.
It’s the entire structure of the top-level site and all its subsites that have the same owner and share administrative settings.
The top-level site is automatically created when you create a site collection. You can then create one or more subsites below the top-level site.
- The maximum recommended number of site collections per farm is 750,000 site collections (500,000 Personal Sites plus 250,000 for all other site templates).
- The supported limit for SharePoint Site Collections per Content Database is 10,000 site collections. (2500 for non-personal site collections and 7500 for personal site collections.)
- Although the supported site collections are 10,000, it’s strongly recommended to limit the number of site collections per content database to 5000.
- The recommended site collection size should not exceed 100 GB.
- Larger site collections per content database lead to slowness and longer downtime during operation tasks like backup, restore and upgrade.
It’s a web site (a group of related web pages) that you can create under the site collection.
Each new subsite can have its independent language and template.
Additionally, you can give permission to access your new site to the same users who have access to this parent site, or you can give permission to a unique set of users.
Furthermore, you can also create additional subsites under a subsite.
SubSite Limits and Recommendations
- The supported limit for subsites per farm is 250,000 subsites.
- The supported limit for subsites per site collection is 250,000 and it’s the same number of subsites per farm.
- The recommended subsites per site collection are 2000 subsites.
- It’s recommended to deploy multiple site collections If you are planning to create more than 2000 web sites per site collection. In this case, the max site collections number that you can create per farm is 125 site collections. (125 site collection * 2000 web site) = 250,000 subsites and this the supported number of subsites per farm.
You may also like to check SharePoint 2019 Limitations.
Site Collections List Per Farm
As we earlier mentioned, the supported limit for SharePoint Site Collections per farm is 750,000 site collections.
The maximum recommended number of site collections per farm is 500,000 Personal Sites plus 250,000 for all other site templates.
Get All Site Collections Per Farm Using PowerShell
In Central Administration, you can get the full list of site collections per web application.
But it’s almost difficult to get the full list of site collections per farm!
In this case, you can easily use PowerShell to list all site collections per farm as the following:
- Open SharePoint Management Shell as Administrator.
- Run the below cmdlet.
Get-SPSite
Below is the result of running “Get-SPSite” to get the site collections list per farm.
How many Site Collections Per Farm?
You can also get the count of Site Collections per farm using PowerShell as the following:
$SCCount = (Get-SPSite).count Write-Host "the number of site collections per farm" $SCCount -ForegroundColor green
Site Collections List Per Web Application
You can get the list of site collections per web application using PowerShell as well as the central administration.
Get All Site Collections List Per Web Application Using Central Administration
- Open Central Administration, Click on “Application Management”.
- Below “Site Collection”, click on “View All Site Collections”.
- You can select which web application you would like to view its site collections as shown below.
Additionally, you can find
- which content database the site collection is stored.
- The Site Collection Title.
- The Site Collection Administrator (Owner).
Get All Site Collections List Per Web Application Using PowerShell
Below are the steps to get the SharePoint Site Collections List per web application using PowerShell
- Open SharePoint Management Shell as Administrator.
- Run the below cmdlet
Get-SPSite -WebApplication "WebAppUrl"
Get Site Collection Administrator Using PowerShell
You can get the Site Collection owner using PowerShell by specifying the owner field as shown below:
Get-SPSite -WebApplication https://epm:7000 | select url,owner,contentdatabase| Format-List
Get Site Collection Title Using PowerShell
You can get the Site Collection title using PowerShell by using @{Name=”Site Collection Title”; Expression={$_.RootWeb.Title}}
Get-SPSite -WebApplication https://epm:7000 | select url,@{Name="Title"; Expression={$_.RootWeb.Title}},owner,contentdatabase| Format-List
How many Site Collections Per Web Application?
To know How many site collections per web application using PowerShell, you should do the following:
- Open SharePoint Management Shell as Administrator.
- Run the below cmdlet
$SCCount = (Get-SPSite -WebApplication http://epm:7000).count Write-Host "the number of site collections per web application" $SCCount -ForegroundColor green
Site Collections List Per Content Database
As we earlier mentioned, the supported limit for SharePoint Site Collections per Content Database is 10,000 site collections. (2500 for non-personal site collections and 7500 for personal site collections.)
Although the supported site collections are 10,000, it’s strongly recommended to limit the number of site collections per content database to 5000.
Get All Site Collections Per Content Database Using PowerShell
In Central Administration, there is no option to get the list of site collections per content database.
In this case, you should use PowerShell to get the site collections list per content database by running the below cmdlet:
Get-SPSite -ContentDatabase "Content Database Name"
How many Site Collection Per Content Database?
You can get the count of Site Collection per Content Database using the Central Administration as well as the PowerShell.
Current number of Site Collection Per Content Database Using Central Administration
To get how many site collections per content database using central administration, you should do the following:
- Open Central Administration, below Application Management, click on “Manage content databases”.
- You can get the list of content databases and the number of associated site collections per a specific web application.
To show the list of a content database for a specific web application, you should click on “Change Web Application” and select the web application that you need to list its associated content databases.
Current number of Site Collection Per Content Database Using PowerShell
To know How many site collections per content database using PowerShell, you should run the below cmdlet:
$SCCount = (Get-SPSite -ContentDatabase PWA_Content_DB_7000).count Write-Host "the number of site collection per content database" $SCCount -ForegroundColor Green
Which Content Database stores the Site Collection
As we earlier discussed, you can know the associated content database for a site collection using Central Administration.
Here, we’ll learn how to know which content database the site collection is stored using powerShell.
Get-SPSite -WebApplication https://epm:7000 | select contentdatabase,url| Format-List
Get Current Site Collection Size
In this section, we will show how to use PowerShell to
- Get Current Site Collection Size Per Web Application.
- Get Current Site Collection Size Per Content Database.
Get Current Site Collection Size Per Web Application
Using PowerShell, you can get the current size of each site collection per web application by running the below cmdlet:
Get-SPWebApplication -Identity http://epm:7000 | Get-SPSite | select url,@{Name="Site Collection Size (MB)";Expression={[math]::Round($_.usage.storage/(1MB),2)}}
Get Current Site Collection Size Per Content Database
Using PowerShell, you can get the current size of each site collection per content database by running the below cmdlet:
Get-SPSite -ContentDatabase "Content Database Name" | select url,@{Name="Site Collection Size (MB)";Expression={[math]::Round($_.usage.storage/(1MB),2)}}
Web Sites List Per Web Application
As we earlier mentioned, The supported limit for subsites per farm is 250,000 subsites, and it’s the same supported number per site collection.
Get All Web Sites Per Web Application Using PowerShell
Actually, It’s almost impossible to list all subsites (web sites) per a web application.
In this case, you should use Powershell to get the subsites list per web application.
Get-SPWebApplication http://epm:19812 | Get-SPsite | get-spweb -Limit all
Note: This result includes the parent site and its subsites.
How many Subsites Per Web Application?
To know How many subsites per web application, you should run the below cmdlet:
$subsiteCount=(Get-SPWebApplication "Web APp URL" | Get-SPsite | get-spweb -Limit all).count Write-Host "The number of Subsites per web application is" $subsiteCount -ForegroundColor green
Web Sites List Per Site Collection
As we earlier mentioned, the number of recommended subsites per site collection is 2000 subsites.
If you are planning to create more than 2000 web sites per site collection. It’s recommended to deploy multiple site collections. In this case, the max site collections number that you can create per farm is 125 site collections. (125 site collection * 2000 web site) = 250,000 subsites and this the supported number of subsites per farm.
Get All Web Sites Per Site Collection Using PowerShell
In Site Content, you can only get the list of subsites for the current parent site.
But, if you would like to get the full list of all subsites under the current site collection, you should run the following cmdlet:
Get-SPsite -Identity "Site Collection URL" | get-spweb -Limit all
How many Subsites Per Site Collection?
To get the count of all subsites per site collection, you should run the below cmdlet:
$SubSiteCount = (Get-SPsite -Identity "Site Collection URL" | get-spweb -Limit all).count Write-Host "the number of subsites per site collection is" $SubSiteCount -ForegroundColor green
Web Application Vs Content Database Vs Site Collection Vs SubSites
- Each web application can hold multiple Content Databases.
- Each web application can hold multiple Site Collections.
- Each Content Database can hold multiple Site Collections.
- Site Collection can be only stored in one Content Database.
- You can’t create a site collection without having a web application with a content database.
- Each Site Collection can hold multiple SubSites.
- Each SubSite can also hold additional SubSites.
- You can’t create a subsite without having a top-level site collection.
You may also like to read
In this section, we’ll introduce a simple PowerShell script that helps you to get the following:
- The list of all SharePoint Site Collections per farm.
- The list of all SharePoint Site Collections per web application.
- The list of all SharePoint Site Collections per content database.
- The list of all SharePoint Subsites per site collection.
- Which Content Database stores the Site Collection?
- What’s the current size of Site Collection?
- How many site collections per farm?
- How many site collections per each web application?
- How many site collections per each content database?
- How many Subsite per each site collection?
- A warning alert if the supported limit exceeded.
Download the “Site Collections and SubSites per SharePoint farm” script on GitHub.
SharePoint Farm Scan Report is a PowerShell Script that helps you to scan farm objects to monitor the SharePoint farm limits by getting real statistics that would help you to administrate your farm effectively and efficiently.
SharePoint Farm Scan Report Statistics includes:
- List of SharePoint web applications per farm.
- The number of SharePoint web applications per farm.
- List of SharePoint Application Pools.
- The number of SharePoint application pools.
- List of running SharePoint service applications per farm.
- The number of running SharePoint service applications per farm.
- List of SharePoint content databases per farm.
- The number of SharePoint content databases per farm.
- List of SharePoint content databases per web application.
- The number of SharePoint content databases per web application.
- What’s the current content database size?
- List of SharePoint site collections per farm
- The number of SharePoint site collections per farm.
- List of SharePoint site collections per web application
- The number of SharePoint site collections per web application.
- List of SharePoint site collections per content database.
- The number of site collections per content database.
- Which content database stores the site collection?
- What’s the Site collection size?
- List of SharePoint SubSites Per farm.
- The number of SharePoint SubSites per farm.
- List of SharePoint SubSites per site collection.
- Total number of SubSites per site collection.
- Farm Report Summary.
Download the “SharePoint Farm Scan Report” full script on GitHub.
Applies to
- SharePoint 2019.
- SharePoint 2016.
- SharePoint 2013 / SharePoint 2010.
Download
- PowerShell Script: SharePoint Farm Scan Report.
- PowerShell Script: Web applications and application pools per SharePoint farm.
- PowerShell Script: Content database per SharePoint farm.
- PowerShell Script: Site collections and Subsites per SharePoint farm.
Conclusion
In conclusion, we have learned the following:
- What’s the SharePoint Site Collection?
- SharePoint Site Collection Limits and Recommendations
- What’s the SharePoint SubSite?
- Get All Site Collections Per Farm Using PowerShell
- How many Site Collections Per Farm?
- How many Site Collections Per Web Application?
- How many Site Collection Per Content Database?
- Which Content Database stores the Site Collection
- Get Current Site Collection Size
- How many subsites Per Web Application?
- How many Subsites Per Site Collection?
You may also like to read
- SharePoint Farm Scan Report.
- Get All Web Applications Per Farm.
- Get All Content Databases Per Farm.
- SharePoint 2019: Service Accounts Recommendations.
- SharePoint 2019: SQL Server Recommendations.
- SharePoint 2019 Limitations.
Have a Question?
If you have any related questions, please don’t hesitate to Ask it at deBUG.to Community.
Pingback: Get All Content Databases Per Farm | SPGeeks
Pingback: Get All Web Applications Per Farm | SPGeeks
Pingback: PowerShell Script: SharePoint Farm Scan Report | SPGeeks