Created
December 23, 2014 08:08
-
-
Save rheid/55ba9b59453844c1b701 to your computer and use it in GitHub Desktop.
Create SharePoint Content Database
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Write-Host "===============================================" -ForegroundColor Yellow | |
Write-Host " Create SharePoint Content-Databases " -ForegroundColor Yellow | |
Write-Host "===============================================" -ForegroundColor Yellow | |
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue | |
#Site to Create | |
$Site = 100 | |
#Site per SPContentDatabase | |
$SiteInDatabase = 20 | |
#SharePoint WebApplication | |
$Application = "http://spbizerba01-dev:2408/" | |
#SharePoint DatabaseServer | |
$DatabaseServer = "spserver" | |
#Databasename | |
$ContentDatabaseNaming = "WSS_Content_" | |
$SPDatabases = [System.Math]::Ceiling($Site/$SiteInDatabase) | |
for ($i=1; $i -le $SPDatabases; $i++) | |
{ | |
$databasename = [string]::Format("$ContentDatabaseNameing{0:d4}", $i) | |
$waringlevel = $SiteInDatabase - 3; | |
Write-Host "Create Database: $databasename" -ForegroundColor Green | |
New-SPContentDatabase $databasename -DatabaseServer $DatabaseServer -MaxSiteCount $SiteInDatabase -WarningSiteCount $waringlevel -WebApplication $Application | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment