18 November 2010

Automated SharePoint Installations: Step-by-step

This post is part of a series covering how to configure and run AutoSPInstaller, a set of scripts that can be used to automatically install SharePoint.

Update: This post is currently being updated to reflect the changes in version 3.x and has been broken down into a series of posts. I hope that this will make it easier to follow all necessary steps.

Overview

AutoSPInstaller is a CodePlex project started by Brian Lalancette. The aim of the project is to provide a set of unified scripts to install SharePoint by following best practices.

I have been using automated installations of SharePoint farms for years now and am a big fan of AutoSPInstaller, the open source script library from CodePlex. This blog post started out as a quick guide on how to run the script. It has now evolved into a sectioned step-by-step guide. This is due to the large amount of support request that I get on the matter. I hope you find the information helpful.

Sections:

 

Scripted Installations: The USP and Business Case

Scripted installations creates repeatability and consistency and is very useful when creating separate environments for test, QA and production. You must be sure that the setup in your environment that is used for load testing and acceptance testing is as identical as possible.

The scripts also help when using horizontal farm scaling, the technique used to add a new server node to a farm that spreads the workload over the machines. If we use virtualized environments, we can start up a Windows Server instance, run the scripts and have the new farm node up in less than an hour and be sure that the new server is set up correctly.

When using the standard, GUI-based installer, we get automatic naming of databases, All system databases are named using a random GUID string. The scripted installation will control the database names and make it easier to locate the correct database for your installation.

Last, but not least, this will save you an enormous amount of time. In my cases, I will install a test farm with 1 WFE, 1 Admin server, a QA environment with 2 WFE and 2 Admin servers and a production environment with 2 WFE and 2 Admin servers. Now, I can prepare the base media and three versions of the AutoSPInstaller scripts, one for each farm configuration, and run the installations of all servers simultaneously.

 

Features by Version

The scripts will (in short) perform the following tasks:

  • Re-launch itself in an elevated process to deal with User Access Control
  • Validate data, connectivity and security prior to installation
  • Install the SharePoint binaries, pre-requisites, language packs, Office Web Apps, Forefront for SharePoint agent
  • Discover other target servers in your farm and remote into each of them to perform the installation process
  • Configure shared farm services
  • Provision web applications and apply site templates
  • Log all activity to a file on the current user's desktop, and pop open the log file for review when finished

New in v3

  • Centralized, remote install of every SharePoint server in your farm using PowerShell remoting
  • Support for parallel binary installations, whether remote install is enabled or not (useful for speeding up multi-server farm installs)
  • Ability to specify a different SQL server for each web application and service application, plus support for creating an alias for each (except Search, currently)
  • Screen output and log both now display the elapsed time to install SharePoint and Office Web App binaries
  • Specify an arbitrary XML input file by passing the XML file name as an argument, or just dragging it onto AutoSPInstallerLaunch.bat

New in v2.5
The ability to use a single AutoSPInstallerInput.XML file for your entire farm, and simply include the names of servers (comma-delimited) on which you want particular service instances or service applications installed.

<ManagedMetadataServiceApp Provision="SPAPPSRV1, SPAPPSRV2"

New in v2

  • Portal super user and super reader accounts can now be configured per best practices
  • MAJOR code and XML schema refactoring
  • Enterprise Search now properly sets both the service account and the crawl (content access) account
  • Much better multi-server farm support

28 comments:

  1. Excellent step-by-step on Automated SharePoint 2010 Install / Config

    ReplyDelete
  2. This page helped but we're stil having trouble.

    How do the System Accounts map to the AutoSPInstallerInput.xml? Some of them are self-explanatory but some are not.

    Thank you.

    ReplyDelete
  3. Hi,

    I see you are using v2 of the installer. You start off by registering all your system accounts under Configuration/Farm/ManagedAccounts and these should include

    - Farm admin
    - Application pool (services)
    - Application pool (portal or app)
    - Service account(s)
    - Profile crawl

    On top of this, you will need an account for the install account, which should be local admin on all SharePoint servers and also dbcreator and securityadmin on your SQL.

    Your profile access account also need rights to iterate changes in the AD.

    You also need to specify, if needed, the super fetch cache accounts under ObjectCacheAccounts section.

    Accounts to go where:

    - Add the portal pool account under WebApplications/WebApplication/applicationPoolAccount.

    - Add the services application pool account under the MySiteHost application.

    - Use the SERVICE account for the EnterpriseSearchService service, no password

    - Use the services application pool account for the ApplicationPool under EnterpriseSearchServiceApplication

    - Specify content access account and password under EnterpriseSearchServiceApplication/ContentAccessAccount. This is not added as a managed account.

    Good luck!

    ReplyDelete
  4. As an update, I added a whole section of account mapping to make this easier.

    ReplyDelete
  5. Hi,
    1- Which is the install account for SQL Server ? SPS_INSTALL, or SQL_Service ?
    2- for the out-going email address, it should be created for SPS_FARM or SPS_INSTALL ?

    Many thanks and best regards

    ReplyDelete
  6. Hi Son,

    1: Use SQL_Service for the SQL server installation
    2: Outgoing email can be anything, I prefer to set up either a group email address or a "noreply@company.com" address. Just make sure your email server accepts the address - in Exchange, you just have to have an address set up that matches the entry.

    ReplyDelete
  7. Hi,
    Thank you for the great document !i have some questions:
    1- Can i use the account SPS_SERVICES, as service account for PerformancePoint,Visio, Excel,,etc or is it better to create for each of them one service account ?
    2- My topoology is two front server (with NLB) and two Database servers (Clustor A\P A\P ), and two index server (Two index partion mirrored) ,what the modifications i have to do in the AutoSPInstallerInput.xml file ? and what are the steps ?

    Many thanks and best regards.

    ReplyDelete
  8. Hi Abdulmunem,

    First, yes you can use the SPS_SERVICES account for the office services.

    Second, I have not tried setting up a partitioned index using the scripts myself yet, but I think you should specify server specific versions of your AutoSPInstallerInput.xml files and specify the names of the servers and roles under EnterpriseSearchServiceApplications/EnterpriseSearchServiceApplication per each config. As default, the script installs all the components on the server. Remove these sections from the WFE config files and first index server, then set up the server names using full names instead of localhost when executing the setup on the last server.

    ReplyDelete
  9. Hi Tobias,
    When i try to open any site i got the following message: An unexpected error has occurred.
    I made sure that the pool accounts are added to "Log as a batch job" in the local group policy, but always the same error.
    When i added the pool accounts to the Local administrator group , the site started to work perfectly !.
    But i dont think it is the right way to keep these accounts in the local Administrator group right ? any solution for this issue ?

    Many thanks.

    ReplyDelete
  10. Hi Abdulmunem,

    I have seen these issues before and they are normally due to security issues. They are also normally resolved by recreating the web application but obviously it is preferable that the whole installation is scripted.

    First of all, have you analyzed the ULS logs and got a more detailed error?

    I would suggest that you post a bug on the AutoSPInstaller site.

    ReplyDelete
  11. Thanks for your post on using AutoSPInstaller, I have referenced it in a post on my blog http://blog.sharepointsite.co.uk/2010/11/installing-sharepoint-using-dedicated.html

    ReplyDelete
  12. Hi,
    I am trying to install two WFE using this script, First one with all app services and other without.
    But after i finished i found out that WFE02 just forward the queries to WFE01!
    i want when i type http:\\wfe01 or http:\\wfe02 to open the portal.
    Can you please advise if i need to do any extra step to make it work for me ?
    Best Regards.

    ReplyDelete
  13. Hi Paolo,

    The only reason I know of one server forwarding is because of central admin sites. You can email me the configs if you like and I can have a look (tobias@lekman.com).

    ReplyDelete
  14. Anonymous1/8/11

    Hi all,

    I found one issue with this nice script,
    if you are running it on a german OS (and I think this will apply to any installation where the local administrators group is not named 'administrators') you´ll get errors coming from AutoSPInstallerFunction.ps1 whenever 'administrators' is referenced, because this group simply ist named different (administratoren in this case).

    Otherwise, nice script.

    Markus Feldmann

    ReplyDelete
  15. Hi,
    I am deploying the SharePoint 2010 on a 2WFE, 2APP, 2SQL & 1 Reporting Service Server Farm. WFE and APP servers are in the DMZ and using ADFS v2.0 for the authentication into DMZ. Please let me know the changes or additions to the script that's required to achive this.
    Thanks

    ReplyDelete
  16. Hi PBN,

    I have not tried using the script with ADFS v2, please submit this to the codeplex site on http://autospinstaller.codeplex.com/discussions.

    ReplyDelete
  17. Anonymous19/10/11

    Greetings,

    Unsure if this is the location I should post for troubleshooting. Please forgive me if this isn't, I'd gladly go to the site/forum that is maintained for it!

    I'm using your script to setup the initial farm on one box. When running the script I get as far as the warning displayed below and then it stops. I'm not quite sure what could have gone wrong, seeing I used only different accounts and passwords for the dedicated domain accounts (which validate at the start).

    The error, as shown in the log transcript:
    - Creating web applications...
    - Creating Web App "Portal Home"
    New-SPWebApplication : Some or all identity references could not be translated.
    At D:\Install\SP2010_AutoSPInstaller\AutoSPInstaller\AutoSPInstallerFunctions.ps1:1540 char:27
    + New-SPWebApplication <<<< -Name $WebAppName -ApplicationPoolA
    ccount $account -ApplicationPool $AppPool -DatabaseName $database -HostHeader $
    HostHeader -Url $url -Port $port -SecureSocketsLayer:$UseSSL | Out-Null
    + CategoryInfo : InvalidData: (Microsoft.Share...PWebApplication:
    SPCmdletNewSPWebApplication) [New-SPWebApplication], IdentityNotMappedExce
    ption
    + FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletNewSPWeb
    Application

    --------------------------------------------------------------
    Script aborted!
    - Failed to create web application

    Any help would be appriciated!

    Thanks in advance.

    ReplyDelete
  18. Hi,

    Have you removed any of the sections under "ManagedAccounts" from the XML configuration file?

    ReplyDelete
  19. Hi,
    I have updated all the accounts as suggested, when i run the script as admin I get the below error :(, have you experience this issue? any help will be much appreciated.
    - Installing Prerequisite Software:
    - Running Prerequisite Installer...
    - Error:
    --------------------------------------------------------------
    - Script aborted!
    - An unknown error occurred installing prerequisites
    -----------------------------------
    Thanks,
    Santhosh

    ReplyDelete
  20. Hi,

    I do not know what that specific error is. Please post to the isse tracker for AutoSPInstaller at http://autospinstaller.codeplex.com/workitem/list/basic

    ReplyDelete
  21. Hi,

    I would like to know for the CU package,

    Should i take only the lastest CU on february :version Office 2010 cumulative update for February 2012
    or i have to take also the june CU ?

    thanks in advance

    ReplyDelete
  22. Jason Lochan15/6/12

    This is the best introduction to AutoSPInstaller out there -- many thanks.

    ReplyDelete
  23. Anonymous25/6/12

    hi, how about updating it to v3? or does it equal? tnx

    ReplyDelete
  24. Boris_Schlotthauer9/7/12

    Hi,
    many thanks for this useful documentation. I've just used version 3. The built-in accounts in the v3 script (in my configuration) have changed to:

    SP_FarmAdmin
    SP_Services
    SP_PortalAppPool
    SP_ProfilesAppPool
    SP_SearchService
    SP_SearchContent

    SP_CacheSuperUser
    SP_CacheSuperReader
    SP_ProfileSync

    SP_ExcelUser
    SP_VisioUser
    SP_PerfPointUser

    Best regards

    Boris

    ReplyDelete
  25. I have created a GUI configuration tool for AutoSPInstaller, check it out at http://autospinstallergui.codeplex.com

    ReplyDelete
  26. Good Day,
    The most complex "Farm" I have set up has been a simple two VM farm.
    I am a SharePoint developer and the newest member in shop where I wear the Architect Hat as well.
    Question: When I create the installation structure of files and run SPAutoInstaller which machine (or VM)am I running SPAutoInstaller from?

    A. My Laptop on my Domain?
    In this case SPAutoInstaller is RDPing into each machine?
    B. One of the VMs involved?
    C. If "B." Does it matter which VM (the SQL server VM, etc.)?

    Also, in the current scenario, the SQL machine is already part of an existing farm and the "New Config DB" will be on a New Instance of SQL server on that machine
    How does that configuration change how I configure SPAutoInstaller?
    i.e., do I still need to have the AutoInstaller re-install SP Server on that SQL server machine?
    I am hoping you are reading these posts often as I am supposed to be doing this next week...
    Thanks and Cheers

    ReplyDelete
    Replies
    1. Hi,

      You execute the scripts from the SharePoint VM. You can attach the files, from a folder, as a drive unit inside the VM.

      If you use a new instance, then name that in the database configuration part of the settings file by creating an alias.

      You should probably not install SharePoint on your SQL server. If you need two SharePoint servers, then add a third VM.

      Delete
    2. Thanks this confirms what I was thinking
      Cheers

      Delete

Feel free to add your comment to this post. All comments are moderated and may not appear immediately within the page.

Tobias Lekman
Search this blog