Install SharePoint 2010 Step 1 - Setup Farm

Here is my latest PowerShell command for setting up SharePoint 2010.  Please not that you must edit the variables in the beginning of the file to match your environment.

When this command is complete you will be able to browse to the central administration web site and begin configuring your farm.

Note: the popup credential prompt is for the Farm Account.  It should be entered as domain\account.

Run each command one at a time.  Trying to run all of these in one PowerShell command can be risky.
a trick to running commands one at a time is to edit the script and use mulit-line comments to comment out the other lines.  Multi-line comments in PowerShell are:

This will all
be commented out and not run.

# These commands will configure a blank SharePoint 2010 farm with custom database names.  (These databases must be created in advance)

These variables must be changed to suit your setup (use your own Passphrase).
Create these 2 databases on the SQL Server first and give your setup account that you are using to run this script db_owner permissions on these 2 databases or the script will error at the first command after entering the credentials.
$ConfigDBName = "SP2010_Prod_Configuration"
$AdminContentDBName = "SP2010_Prod_AdminContent"

$DatabaseServer = "sql08r2"
$Domain = "dev.local"
$Passphrase = "Password123"
$CentralAdminPort = "3333"

# Print out the variables used in this script to the screen.
Write-Host "The variables used in this command are:"
Write-Host "Database Server                 : $DatabaseServer"
Write-Host "Configuration database Name     : $ConfigDBName"
Write-Host "Admin Content database Name     : $AdminContentDBName"
Write-Host "Domain is                       : $Domain"
Write-Host "Passphrase is                   : $Passphrase"
Write-Host "Central Admin website port is   : $CentralAdminPort"

# Setup the configuration and admin content databases, the passphrase, and the farm account
New-SPConfigurationDatabase -DatabaseName $ConfigDBName -DatabaseServer $DatabaseServer -DirectoryDomain $Domain -AdministrationContentDatabaseName $AdminContentDBName -FarmCredentials (Get-Credential) -Passphrase (ConvertTo-SecureString $Passphrase -AsPlainText -force)

# Install the help files
Install-SPHelpCollection -All

# Secure the files and registry entries on the server

# Install and then provision the services onto the farm

# Install the features on the server
Install-SPFeature –AllExistingFeatures

# Provision the central admin web application on our desired port.
New-SPCentralAdministration -Port $CentralAdminPort  -WindowsAuthProvider "NTLM"

# Install all of the application content


Popular posts from this blog

SharePoint Designer 2013 Approval Workflow with Comments

Change SharePoint server hostname and Web Application Names

SharePoint Search - Content Processing Pipeline Failed to Process the Item