30 Jan, 2011
Automate SharePoint 2010 farm configuration with PowerShell
Last year my friend Michael Noel asked me to contribute a chapter for his SharePoint 2010 Unleashed book, and I wrote a chapter on SharePoint 2010 PowerShell automation. As part of that book project we wrote a number of SharePoint PowerShell scripts with two scripts configuring SharePoint 2010 farm and most of the service apps without using Configuration Wizard. The original script was written by Muhanad Omar MVP, while the service app config script was written by me. Both scripts were tested by Conan Flint and Michael Noel.
|1. Config SharePoint 2010 Farm Script|
|2. Config SharePoint 2010 Service Apps Script|
- Download the above scripts to your SharePoint server (scripts will be downloaded as .txt files, rename them to .ps1)
- Install all prerequisites and start SharePoint 2010 installation
- When installation completes, do not run the Configuration Wizard (uncheck option)
- Open PowerShell Shell (run as Administrator) and navigate to the location of the scripts you saved (e.g. cd C:\Scripts)
- User running PowerShell shell needs to have proper privileges on the SQL Server to create and configure SharePoint databases and admin privileges on the server
- Type .\Config-Farm.ps1 and the configuration script will start
- You will be asked to provide name of your SharePoint farm, service account logon credentials and other configuration options (figure)
- When asked for passphrase make sure you choose one that meets complexity requirements
- In the second step you will be asked if you want to configure service apps and you will have the option to choose the ones you want to install
Please note: The script does not allow you to install User Profile and PerformancePoint Service applications. For more advanced scripts you should check open-source project AutoSPInstaller on CodePlex.