Monday, June 18, 2012

SharePoint 2010 - Creating the Farm By PowerShell

I found a blog, there are scripts for creating Farm, Web Application, Site Collection: http://blog.brianbeach.com (all credits to Brian). I want to write it here, like a reminder for myself. In addition, I think that the sharing knowledge is a best way to help to each other.




Add-PSSnapin Microsoft.SharePoint.Powershell -EA 0
Clear-Host

$FarmAccountName = "DOMAIN\SERVICE_ACCOUNT"
$Passphrase = "PASSWORD"
$DatabaseServer = "DATABASE_SERVER_NAME"
$ConfigDatabase = "Config"
$ContentDatabase = "Content_Admin"

Write-Host "Creating Configuration Database"
$FarmAccount = Get-Credential $FarmAccountName
$Passphrase = (ConvertTo-SecureString $Passphrase -AsPlainText -force)
New-SPConfigurationDatabase -DatabaseServer $DatabaseServer -DatabaseName $ConfigDatabase -AdministrationContentDatabaseName $ContentDatabase -Passphrase $Passphrase -FarmCredentials $FarmAccount

Write-Host "Configuring Farm"
Initialize-SPResourceSecurity
Install-SPService
Install-SPFeature -AllExistingFeatures

Write-Host "Configuring Central Administration"
New-SPCentralAdministration -Port 8080 -WindowsAuthProvider NTLM
Install-SPHelpCollection -All
Install-SPApplicationContent



No comments:

Post a Comment