SharePoint Content database – maxsitecount and warningsitecount – PowerShell


Quick Help Script:

How to set the maxsitecount and warningsitecount  on a content database either after the upgrade or migration or even after moving the content database from different farm or web application.

Add-PSSnapin microsoft.sharepoint.powershell
$dbs = get-spcontentdatabase -webapplication https://webapplicationname
foreach($db in $dbs.name) {Set-SPContentDatabase -Identity $db -MaxSiteCount 1 -WarningSiteCount 0}

Continue reading