This article is a re-post of the article I authored for MSSharePointTips which can be found here: MSSharePointTips Article
This article primarily applies to SharePoint 2010 (Foundation or Server). For SharePoint 2007, skip to the bottom.
Automating SharePoint installation means performing a series of steps to setup your SharePoint Farm without user interaction. There are various tools we can use to help with this, some that will just install SharePoint, some that will help with initial Farm configuration and others that go a bit further.
Automating or scripting any installation brings several benefits, some more obvious than others:
- Finer control of naming conventions such as database names, site names, etc. (side effect)
- Reduce errors, such as in database naming conventions, disk or folder placement, and service accounts.
- Provide consistency across environments and across different Farms. For example, a development, testing, and production environment.
- Save time by letting the install run while you do something more important than watching progress bars
How you ask? Well there are a few options.
If youâ€™re just installing SharePoint for development purposes, you can use this Script to Install SharePoint 2010 on Windows 7. Note, for Windows 7 only. This script does a nice job of getting you up and running fast. It enables all the required Windows Roles and Features, downloads and installs pre-requisites, and installs SharePoint 2010. Itâ€™s a single uncomplicated script with just a few prompts (such as for your product key).
For a less restricted approach, such as being able to install on Windows Server, you can use SPModule. Zach Rosenfieldâ€™s blog post titled SPModule.HelloWorld() has some more specifics on how to install the module, sign it, and use the command functions. It canâ€™t get any easier than this: Use Install-SharePoint to install; New-SharePointFarm to create a new farm! Zach even explains how you can use SPModule to run several SharePoint installs remotely in parallel (Remote Install of SharePoint).
My favorite option is to use AutoSPInstaller. Brian Lalancette (twitter @brianlala) has done all the work in collecting scripts, tips, and other information from various sources and has put together a very nice script. You just unzip the package into your existing SharePoint installation source (I recommend copying/extracting your SharePoint DVD/CD/ISO to a network share) and edit an XML file. Then, you simply run â€œlaunch.batâ€ and away it goes.
During a recent deployment, I configured one input XML file for each of my servers. They were essentially the same (same service accounts, database names, etc.) and I just needed to change the Web App name. This allowed me to run 4 or 5 installs simultaneously. I configured the script to install language packs and all the prerequisites from my network share as well.
Unlike the other two options, when youâ€™re done here, you have all the essential services you need (Managed Metadata, User Profile, Search, Secure Store, Web Analytics, and more). You can configure it NOT to install one or all of these (I donâ€™t need Web Analytics). Additionally, it can create a Web App with a site collection and even your My Site host.
Best of all, since youâ€™re specifying your database names, theyâ€™re clean without GUIDs!
Before you start, I do recommend you review service account permissions. Check out Todd Klindtâ€™s Suggestions (twitter @toddklindt) or my wiki page: Permissions Chart (essentially the same info). Also set up SQL Aliases (so you can specify them in your script) and copy updates to the \Updates folder in your SharePoint installation source. I used the August Cumulative Updates for SharePoint Server 2010.
Scripted installs can save time, provide consistency and make it easier if you need to rebuild the Farm. Use the approach youâ€™re most comfortable with considering your purpose and environment or create your own using the samples here. Although it may take a bit longer to learn and properly configure these scripts up front, the effort will be well worth it.
For an excellent write up on automating SharePoint 2007 installation (install, provision, etc.), see Joel Olesonâ€™s (@joeloleson) post: Automating and Scripting SharePoint Administration and be sure to check out Gary LaPointeâ€™s (@glapointe) Sample Script.