At first glance, you may think that installing SharePoint from the GUI is your best approach, as it is very easy and just about anyone can click through the wizard. The problem with this type of install is that you do not have the flexibility to name your configuration database the way you want. By choosing the wizard based approach, you will receive a GUID inside your database name. PowerShell has a number of commands that help make this a simple process. This article will walk you through the cmdlets responsible, describe what each of them do, and then give you a working example. All we are doing here is creating the configuration and administration databases.
Once you have the farm provisioned we will move on to the configuration aspects which will include the services, applications, etc.
There are seven cmdlets that you will need to provision your farm so that you can access it correctly. The cmdlets are listed below along with their descriptions provided by the Get-Help cmdlet.
The New-SPConfigurationDatabase cmdlet creates a new configuration database on the specified database server. This is the central database for a new SharePoint farm.
The Install-SPHelpCollection cmdlet installs the Help site collection files for SharePoint 2010 Products in the current farm. Use the LiteralPath parameter to install specific custom Help collection files. If the LiteralPath parameter is not specified, all available Help in the Help site collection is installed and existing Help collection files are overwritten.
The Initialize-SPResourceSecurity cmdlet enforces resource security on the local server. This cmdlet enforces security for all resources, including files, folders, and registry keys.
The Install-SPService cmdlet installs and optionally provisions services on a farm. This cmdlet installs all services, service instances, and service proxies specified in the registry on the local server computer. Use this cmdlet in a script that you build to install and deploy a SharePoint farm or to install a custom developed service.
The Install-SPFeature cmdlet installs a specific SPFeature object by providing in the Identity parameter the relative path from the folder “$env:ProgramFilesCommon FilesMicrosoft SharedWeb Server Extensions14TEMPLATEFEATURES to the feature. The SharePoint Feature’s files must already be put in the proper directory, either manually or by using a solution installer.
If the AllExistingFeatures parameter is provided, the file system is scanned and any new features are installed. This is generally only used during deployment and upgrade.
The New-SPCentralAdministration cmdlet creates a new Central Administration Web application and starts the central administration service on the local machine. Central Administration is available only on computers where this service runs.
The Install-SPApplicationContent cmdlet copies shared application data to existing Web application folders. This cmdlet does not take any parameters.
# Create a new SharePoint Configuration and Administration database, use “pass@word” as the passphrase.
New-SPConfigurationDatabase –DatabaseName “PS4SP_SP2010_Config” –DatabaseServer “<Your DB Server>” –AdministrationContentDatabaseName “SharePoint2010_Admin_Content” –Passphrase (ConvertTo-SecureString “pass@word1” –AsPlaintext –Force) –FarmCredentials (Get-Credential)
# Installs the Help site collection files for SharePoint 2010 Products in the current farm
# Enforces resource security on the local server
# Installs services on a farm
# The file system is scanned and any new features are installed
# Creates a new Central Administration Web application and starts the central administration service on the local machine
New-SPCentralAdministration -Port 11030 -WindowsAuthProvider “NTLM”
# Copies shared application data to existing Web application folders